Update ca-certificates to use new Alpine base image

This is what the other images should look like in future.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack 2017-05-03 15:04:27 +01:00
parent edfac0e8fb
commit 26f7d6ebdd
2 changed files with 7 additions and 28 deletions

View File

@ -1,6 +1,6 @@
FROM alpine:3.5 as alpine
FROM linuxkit/alpine:f0169b60fb260d74025496ae6fd93213fecaba8f as alpine
RUN apk update && apk upgrade -a && apk add --no-cache ca-certificates
RUN apk add ca-certificates
FROM scratch
ENTRYPOINT []

View File

@ -1,34 +1,13 @@
.PHONY: tag push
BASE=alpine:3.5
IMAGE=ca-certificates
SHA_IMAGE=alpine:3.5@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8
HASH?=$(shell git ls-tree HEAD -- ../$(notdir $(CURDIR)) | awk '{print $$3}')
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}
tag: Dockerfile
docker build --network=none -t linuxkit/$(IMAGE):$(HASH) .
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:
push: tag
docker pull linuxkit/$(IMAGE):$(HASH) || docker push linuxkit/$(IMAGE):$(HASH)