From 81f42a2b3bdec9202d0c2fe652e01095e14376ad Mon Sep 17 00:00:00 2001 From: Avi Deitcher Date: Sun, 21 May 2023 22:32:53 +0100 Subject: [PATCH] guestfs native arm64 Signed-off-by: Avi Deitcher --- tools/guestfs/Dockerfile | 21 +++++++++++++++++++-- tools/guestfs/Makefile | 27 --------------------------- tools/guestfs/build.yml | 5 +++++ 3 files changed, 24 insertions(+), 29 deletions(-) delete mode 100644 tools/guestfs/Makefile create mode 100644 tools/guestfs/build.yml diff --git a/tools/guestfs/Dockerfile b/tools/guestfs/Dockerfile index 9592aba2f..1c3123e07 100644 --- a/tools/guestfs/Dockerfile +++ b/tools/guestfs/Dockerfile @@ -1,4 +1,21 @@ -FROM debian:stretch +FROM debian:bullseye-slim as base + +ARG TARGETARCH ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get -yq upgrade && apt-get install -yq libguestfs-tools syslinux linux-image-amd64 vim + +FROM base as syslinux-amd64 +# syslinux package is only available on amd64; for arm64, use +# the limited subset of syslinux-common +ENV SYSLINUX="syslinux" + +FROM base as syslinux-arm64 +ENV SYSLINUX_arm64="syslinux-common" + +FROM syslinux-${TARGETARCH} as syslinux +RUN apt-get update && \ + apt-get -yq upgrade && \ + apt-get install -yq libguestfs-tools \ + ${SYSLINUX} \ + linux-image-${TARGETARCH} \ + vim diff --git a/tools/guestfs/Makefile b/tools/guestfs/Makefile deleted file mode 100644 index 67779888f..000000000 --- a/tools/guestfs/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -.PHONY: build push - -IMAGE=guestfs - -default: push - -iid: Dockerfile - tar cf - $^ | docker build --no-cache --iidfile iid - - -hash: Makefile iid - docker run --rm $(shell cat iid) sh -c 'apt list --installed 2>/dev/null | sha1sum' | sed 's/ .*//' > hash - -push: hash iid - docker pull linuxkit/$(IMAGE):$(shell cat hash) || \ - (docker tag $(shell cat iid) linuxkit/$(IMAGE):$(shell cat hash) && \ - docker push linuxkit/$(IMAGE):$(shell cat hash)) - rm -f iid - -build: hash iid - docker pull linuxkit/$(IMAGE):$(shell cat hash) || \ - docker tag $(shell cat iid) linuxkit/$(IMAGE):$(shell cat hash) - rm -f iid - -clean: - rm -f hash iid - -.DELETE_ON_ERROR: diff --git a/tools/guestfs/build.yml b/tools/guestfs/build.yml new file mode 100644 index 000000000..a88f04a73 --- /dev/null +++ b/tools/guestfs/build.yml @@ -0,0 +1,5 @@ +image: guestfs +network: true +arches: + - arm64 + - amd64