mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-12-04 00:02:01 +00:00
Added to Docker example as Swarm mode likes time sync. Note uses pool.ntp.org at present, on some providers it should use a different source. Constraints not enabled as they seem to have an issue; possibly trying to set before network is up. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
30 lines
757 B
Makefile
30 lines
757 B
Makefile
.PHONY: tag push clean container
|
|
default: push
|
|
|
|
IMAGE=openntpd
|
|
|
|
BASE=alpine:3.5
|
|
|
|
hash: Dockerfile etc/ntpd.conf
|
|
DOCKER_CONTENT_TRUST=1 docker pull $(BASE)
|
|
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
|
|
docker run --rm $(IMAGE):build sh -c 'cat $^ /lib/apk/db/installed | sha1sum' | sed 's/ .*//' > hash
|
|
|
|
push: hash
|
|
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
|
(docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash) && \
|
|
docker push mobylinux/$(IMAGE):$(shell cat hash))
|
|
docker rmi $(IMAGE):build
|
|
rm -f hash
|
|
|
|
tag: hash
|
|
docker pull mobylinux/$(IMAGE):$(shell cat hash) || \
|
|
docker tag $(IMAGE):build mobylinux/$(IMAGE):$(shell cat hash)
|
|
docker rmi $(IMAGE):build
|
|
rm -f hash
|
|
|
|
clean:
|
|
rm -rf hash
|
|
|
|
.DELETE_ON_ERROR:
|