Files
linuxkit/pkg/ca-certificates/Makefile
Justin Cormack 713046e158 Update ca-certificates to be based on Alpine and use nested build
We were using Debian but Alpine more consistent. Use nested build.

Currently extract the hash in a nasty way but this can be fixed later
when we switch over hashing method.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-26 15:24:26 +01:00

35 lines
1001 B
Makefile

.PHONY: tag push
BASE=alpine:3.5
IMAGE=ca-certificates
SHA_IMAGE=alpine:3.5@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8
default: push
hash: Dockerfile
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
CONTAINER=$$(docker create $(IMAGE):build /dev/null); \
mkdir tmp && docker export $${CONTAINER} | tar xf - -C tmp && \
cat tmp/etc/ssl/certs/ca-certificates.crt | docker run --rm -i $(SHA_IMAGE) sha1sum - | sed 's/ .*//' > $@ && \
rm -rf tmp && docker rm $${CONTAINER}
push: hash
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
(docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash) && \
docker push linuxkit/$(IMAGE):$(shell cat hash))
docker rmi $(IMAGE):build
rm -f hash
tag: hash
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash)
docker rmi $(IMAGE):build
rm -f hash
clean:
rm -f hash tmp
.DELETE_ON_ERROR: