From 36a63fea489cb94495609f1729e7490c7e4c83ad Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Wed, 10 Apr 2024 17:12:20 -0400 Subject: [PATCH] Add bootc-run target to Makefile This will make it easier for users to run bootc container locally for testing purposes. Signed-off-by: Daniel J Walsh --- recipes/common/Makefile.common | 6 ++++++ recipes/common/README.md | 23 +++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/recipes/common/Makefile.common b/recipes/common/Makefile.common index 68de97f3..bbba3013 100644 --- a/recipes/common/Makefile.common +++ b/recipes/common/Makefile.common @@ -80,6 +80,12 @@ bootc: quadlet @echo " * https://github.com/osbuild/bootc-image-builder" @echo " * https://github.com/containers/podman-desktop-extension-bootc" +.PHONY: bootc-run +bootc-run: + podman run -d --rm --name $(APP)-bootc -p 8080:8501 --privileged \ + $${AUTH_JSON:+-v $${AUTH_JSON}:/run/containers/0/auth.json} \ + $(BOOTC_IMAGE) /sbin/init + .PHONY: bootc-image-builder bootc-image-builder: bootc mkdir -p build/store diff --git a/recipes/common/README.md b/recipes/common/README.md index d7f63708..7316c02d 100644 --- a/recipes/common/README.md +++ b/recipes/common/README.md @@ -1,17 +1,16 @@ # Makefile targets -.PHONY: check-model-in-path - -| Target | Description | -|----------------------|-------------------------------------------------------------------------------| -|bootc | Create bootable container image for the application | -|bootc-image-builder | Create diskimage from your bootc image to be run on a VM or physical hardware | -|build | Build container image to run your app using Containerfile in app directory | -|clean | Remove contents of the build directory | -|quadlet | Modify quadlet files into the build dir | -|run | Run containerizied app as a container | -| install-chromedriver | Used to testing purposes | -| install-chrome | Used for testing purposes | +| Target | Description | +|-----------------------|-------------------------------------------------------------------------------| +| bootc | Create bootable container image for the application | +| bootc-image-builder | Create diskimage from your bootc image to be run on a VM or physical hardware | +| bootc-run | Run bootable container image as a container | +| build | Build container image to run your app using Containerfile in app directory | +| clean | Remove contents of the build directory | +| install-chrome | Used for testing purposes | +| install-chromedriver | Used to testing purposes | +| quadlet | Modify quadlet files into the build dir | +| run | Run containerizied app as a container | # Makefile variables