Files
linuxkit/tools/alpine/Makefile
Dennis Chen 258e4c37d2 alpine: Remove the 'content trust build' workaround
Before the alpine base image is multi-arch and signed, the
DOCKER_CONTENT_TRUST=1 doesn't work on AArch64 for 'docker build'.
Now since the alpine base image is already multi-arch and signed,
also we've used 'push_manifest.sh' to push and sign linuxkit/image,
so we can remove this workaround.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2017-11-17 10:37:40 +00:00

52 lines
1.4 KiB
Makefile

.PHONY: build push
ORG?=linuxkit
IMAGE=alpine
DEPS=packages
ifeq ($(DOCKER_CONTENT_TRUST),)
ifndef NOTRUST
export DOCKER_CONTENT_TRUST=1
endif
endif
ARCH := $(shell uname -m)
ifeq ($(ARCH), x86_64)
DEPS += packages.x86_64
SUFFIX=-amd64
endif
ifeq ($(ARCH), aarch64)
DEPS += packages.aarch64
SUFFIX=-arm64
endif
default: push
show-tag:
@sed -n -e '1s/# \(.*\/.*:[0-9a-f]\{40\}\)/\1/p;q' versions.$(ARCH)
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)/'> $@
versions.$(ARCH): Makefile hash iid
echo "# $(ORG)/$(IMAGE):$(shell cat hash)" > versions.$(ARCH)
docker run --rm $(shell cat iid) find /mirror -name '*.apk' -exec basename '{}' .apk \; | LANG=C sort | (echo '# automatically generated list of installed packages'; cat -) >> versions.$(ARCH)
push: hash iid versions.$(ARCH)
docker pull $(ORG)/$(IMAGE):$(shell cat hash) || \
(docker tag $(shell cat iid) $(ORG)/$(IMAGE):$(shell cat hash) && \
docker push $(ORG)/$(IMAGE):$(shell cat hash))
./push-manifest.sh $(ORG) $(IMAGE)
rm -f iid
build: hash iid versions.$(ARCH)
docker pull $(ORG)/$(IMAGE):$(shell cat hash) || \
docker tag $(shell cat iid) $(ORG)/$(IMAGE):$(shell cat hash)
rm -f iid
clean:
rm -f hash iid