Files
linuxkit/alpine/base/Makefile
Justin Cormack 7420a00ba5 [WIP] Make builds repeatable by tagging an image based on hash of package install
This tags a base Alpine image with the packages we use by finding
the has of the package install manifest and using that to tag
the image on hub.

Hub org needs changing, and not sure how this will work out yet.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-08-17 00:28:08 +01:00

27 lines
984 B
Makefile

.PHONY: tag push
default: push
hash:
docker pull alpine:3.4
tar cf - Dockerfile | docker build --no-cache -t justincormack/moby-alpine-base:build -
rm -f hash
docker run justincormack/moby-alpine-base:build sha1sum /lib/apk/db/installed | sed 's/ .*//' > hash
push: hash
docker pull justincormack/moby-alpine-base:$(shell cat hash) || \
(docker tag justincormack/moby-alpine-base:build justincormack/moby-alpine-base:latest && \
docker tag justincormack/moby-alpine-base:build justincormack/moby-alpine-base:$(shell cat hash) && \
docker push justincormack/moby-alpine-base:$(shell cat hash) && \
docker push justincormack/moby-alpine-base:latest)
rm -f hash
tag: hash
docker pull justincormack/moby-alpine-base:$(shell cat hash) || \
(docker tag justincormack/moby-alpine-base:build justincormack/moby-alpine-base:latest && \
docker tag justincormack/moby-alpine-base:build justincormack/moby-alpine-base:$(shell cat hash))
rm -f hash
clean:
rm -f hash