diff --git a/tools/alpine/Dockerfile b/tools/alpine/Dockerfile index 039981cae..9fc8f593c 100644 --- a/tools/alpine/Dockerfile +++ b/tools/alpine/Dockerfile @@ -93,6 +93,8 @@ RUN set -e && \ FROM alpine:3.13 +ARG TARGETARCH + COPY --from=mirror /etc/apk/repositories /etc/apk/repositories COPY --from=mirror /etc/apk/repositories.upstream /etc/apk/repositories.upstream COPY --from=mirror /etc/apk/keys /etc/apk/keys/ @@ -104,4 +106,6 @@ COPY --from=mirror /iucode_tool /usr/bin/ RUN apk update && apk upgrade -a +RUN echo Dockerfile /lib/apk/db/installed $(find /mirror -name '*.apk' -type f) $(find /go/bin -type f) | xargs cat | sha1sum | sed 's/ .*//' | sed 's/$/-${TARGETARCH}/' > /etc/alpine-hash + ENV GOPATH=/go PATH=$PATH:/go/bin diff --git a/tools/alpine/Makefile b/tools/alpine/Makefile index ad66fc4f7..b78b4d65d 100644 --- a/tools/alpine/Makefile +++ b/tools/alpine/Makefile @@ -7,15 +7,12 @@ DEPS=packages ARCH := $(shell uname -m) ifeq ($(ARCH), x86_64) DEPS += packages.x86_64 -SUFFIX=-amd64 endif ifeq ($(ARCH), aarch64) DEPS += packages.aarch64 -SUFFIX=-arm64 endif ifeq ($(ARCH), s390x) DEPS += packages.s390x -SUFFIX=-s390x endif default: push @@ -27,7 +24,7 @@ iid: Dockerfile Makefile $(DEPS) docker build --no-cache --iidfile iid . hash: Makefile iid - docker run --rm $(shell cat iid) sh -c 'echo Dockerfile /lib/apk/db/installed $$(find /mirror -name '*.apk' -type f) $$(find /go/bin -type f) | xargs cat | sha1sum' | sed 's/ .*//' | sed 's/$$/$(SUFFIX)/'> $@ + docker run --rm $(shell cat iid) cat /etc/alpine-hash > $@ versions.$(ARCH): Makefile hash iid echo "# $(ORG)/$(IMAGE):$(shell cat hash)" > versions.$(ARCH)