From 0f994961b64ccaa509bedaa9c48dee7523490cd1 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 | 21 +++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/recipes/common/Makefile.common b/recipes/common/Makefile.common index 68de97f32..bbba30137 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 d7f63708e..d872a7366 100644 --- a/recipes/common/README.md +++ b/recipes/common/README.md @@ -2,16 +2,17 @@ .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