mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-22 02:21:34 +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
|
FROM alpine:3.13
|
||||||
|
|
||||||
|
ARG TARGETARCH
|
||||||
|
|
||||||
COPY --from=mirror /etc/apk/repositories /etc/apk/repositories
|
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/repositories.upstream /etc/apk/repositories.upstream
|
||||||
COPY --from=mirror /etc/apk/keys /etc/apk/keys/
|
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 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
|
ENV GOPATH=/go PATH=$PATH:/go/bin
|
||||||
|
@ -7,15 +7,12 @@ DEPS=packages
|
|||||||
ARCH := $(shell uname -m)
|
ARCH := $(shell uname -m)
|
||||||
ifeq ($(ARCH), x86_64)
|
ifeq ($(ARCH), x86_64)
|
||||||
DEPS += packages.x86_64
|
DEPS += packages.x86_64
|
||||||
SUFFIX=-amd64
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH), aarch64)
|
ifeq ($(ARCH), aarch64)
|
||||||
DEPS += packages.aarch64
|
DEPS += packages.aarch64
|
||||||
SUFFIX=-arm64
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH), s390x)
|
ifeq ($(ARCH), s390x)
|
||||||
DEPS += packages.s390x
|
DEPS += packages.s390x
|
||||||
SUFFIX=-s390x
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
default: push
|
default: push
|
||||||
@ -27,7 +24,7 @@ iid: Dockerfile Makefile $(DEPS)
|
|||||||
docker build --no-cache --iidfile iid .
|
docker build --no-cache --iidfile iid .
|
||||||
|
|
||||||
hash: Makefile 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
|
versions.$(ARCH): Makefile hash iid
|
||||||
echo "# $(ORG)/$(IMAGE):$(shell cat hash)" > versions.$(ARCH)
|
echo "# $(ORG)/$(IMAGE):$(shell cat hash)" > versions.$(ARCH)
|
||||||
|
Loading…
Reference in New Issue
Block a user