From 24f6503805c94f7b84aef4fb8a2904fbad534015 Mon Sep 17 00:00:00 2001 From: Begley Brothers Inc Date: Wed, 1 Apr 2020 15:47:47 +1100 Subject: [PATCH] Add OCI tool choice Signed-off-by: Begley Brothers Inc --- images/kernel/Makefile | 3 ++- images/kernel/upgrade-config.sh | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/images/kernel/Makefile b/images/kernel/Makefile index f142b2d9d..34f2f9b9d 100644 --- a/images/kernel/Makefile +++ b/images/kernel/Makefile @@ -1,4 +1,5 @@ # Check https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/refs/ for updates +OCI_TOOL?=docker REGISTRY?=weaveworks IMAGE_NAME?=${REGISTRY}/ignite-kernel KERNEL_VERSIONS ?= 4.14.166 4.19.97 5.4.13 @@ -28,7 +29,7 @@ upgrade-%: build: $(addprefix build-,$(KERNEL_VERSIONS)) build-%: - docker build -t $(IMAGE_NAME):$*-${GOARCH} \ + $(OCI_TOOL) build -t $(IMAGE_NAME):$*-${GOARCH} \ --build-arg KERNEL_VERSION=$* \ --build-arg ARCH=${KERNEL_ARCH} \ --build-arg GOARCH=${GOARCH} \ diff --git a/images/kernel/upgrade-config.sh b/images/kernel/upgrade-config.sh index 409e5a162..5330ed2b6 100755 --- a/images/kernel/upgrade-config.sh +++ b/images/kernel/upgrade-config.sh @@ -21,7 +21,13 @@ if [[ ${FROM} != ${TO} ]]; then cp ${FROM} ${TO} fi -docker run -it \ +if ! [ -x "$(command -v podman)" ]; then + oci_tool=podman +else + oci_tool=docker +fi + +${oci_tool} run -it \ ${ARCH_PARAMETER} \ -v $(pwd)/${TO}:/tmp/.config \ ${KERNEL_BUILDER_IMAGE} /bin/bash -c "\