Merge pull request #3650 from deitch/alpine-hash

alpine carry its own hash
This commit is contained in:
Avi Deitcher 2021-05-06 13:11:41 -04:00 committed by GitHub
commit ceef6b1ca2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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)