-
Notifications
You must be signed in to change notification settings - Fork 0
Build and run a container
unitexe edited this page Feb 5, 2025
·
3 revisions
Build and run an amd64 OCI container, the app-container
flask app provided by meta-virtualization
specifically.
source ~/.venv.yocto/bin/activate
Configure the build, work, sstate and download directories based on the distro, machine and release.
export KAS_CONTAINER_ENGINE=podman
export KAS_BUILD_DIR="/home/$(whoami)/dev/yocto/unit/build/styhead/pokyless/amd64-container/"
export KAS_WORK_DIR=$KAS_BUILD_DIR
export SSTATE_DIR="/home/$(whoami)/dev/yocto/unit/build/styhead/sstate/"
export DL_DIR="/home/$(whoami)/dev/yocto/unit/dl"
- Could replace
pokyless
withrocky
here if we want musl
kas-container build images/pokyless/amd64-container/app-container/scarthgap.yml
Position at root of build directory.
cd $KAS_BUILD_DIR
Load image.
podman load -i tmp/deploy/images/amd64-container/app-container-latest-oci.tar
podman run -dt -p 8080:9000/tcp localhost/latest:latest
Send a get request to the oe
endpoint, this will output Hello from OpenEmbedded!
.
curl http://localhost:8080/oe/ && echo
Send a get request to the yocto
endpoint, this will output Hello from Yocto!
.
curl http://localhost:8080/yocto/ && echo
Stop container.
podman stop -l
Remove container.
podman rm -l
Remove image.
podman image rm localhost/latest:latest