mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 10:09:07 +00:00
Merge pull request #3650 from deitch/alpine-hash
alpine carry its own hash
This commit is contained in:
commit
ceef6b1ca2
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user