Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Add OCI tool choice #571

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion images/kernel/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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} \
Expand Down
8 changes: 7 additions & 1 deletion images/kernel/upgrade-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch 👋

Would DOCKER=podman make build be sufficient for you?
This would be consistent with the main Makefile we already have.

Other usage would be:
DOCKER="sudo docker" make build

The kernel build helper scripts would also need to be modified to use this ENV var to override docker.
We could do a followup PR if you don't have the bandwidth to do so.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries: DOCKER=podman. Will try get to that this week and force update this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

fi

${oci_tool} run -it \
${ARCH_PARAMETER} \
-v $(pwd)/${TO}:/tmp/.config \
${KERNEL_BUILDER_IMAGE} /bin/bash -c "\
Expand Down