From 249df1e912e0c6d3e78c737f3dc49db197429ffb Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Fri, 28 Oct 2016 12:39:31 +0100 Subject: [PATCH] Add check-config container and test Currently the test will never fail, planning to fix this upstream. Signed-off-by: Justin Cormack --- alpine/base/check-config/Dockerfile | 4 ++++ alpine/base/check-config/Makefile | 31 +++++++++++++++++++++++++++ alpine/packages/test/usr/bin/mobytest | 2 ++ 3 files changed, 37 insertions(+) create mode 100644 alpine/base/check-config/Dockerfile create mode 100644 alpine/base/check-config/Makefile diff --git a/alpine/base/check-config/Dockerfile b/alpine/base/check-config/Dockerfile new file mode 100644 index 000000000..b0568cf2f --- /dev/null +++ b/alpine/base/check-config/Dockerfile @@ -0,0 +1,4 @@ +FROM alpine:3.4 +RUN apk update && apk upgrade && apk add --no-cache bash +ADD https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh /usr/bin/check-config.sh +ENTRYPOINT ["/bin/bash", "/usr/bin/check-config.sh"] diff --git a/alpine/base/check-config/Makefile b/alpine/base/check-config/Makefile new file mode 100644 index 000000000..90bd789ef --- /dev/null +++ b/alpine/base/check-config/Makefile @@ -0,0 +1,31 @@ +.PHONY: tag push + +BASE=alpine:3.4 +IMAGE=check-config + +default: push + +hash: + docker pull $(BASE) + tar cf - Dockerfile | docker build --no-cache -t $(IMAGE):build - + docker run --entrypoint=/bin/sh $(IMAGE):build -c 'cat /usr/bin/check-config.sh /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 tag $(IMAGE):build mobylinux/$(IMAGE):latest && \ + docker push mobylinux/$(IMAGE):$(shell cat hash) && \ + docker push mobylinux/$(IMAGE):latest) + 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 -f hash + +.DELETE_ON_ERROR: diff --git a/alpine/packages/test/usr/bin/mobytest b/alpine/packages/test/usr/bin/mobytest index 7d11c7744..029317cdb 100755 --- a/alpine/packages/test/usr/bin/mobytest +++ b/alpine/packages/test/usr/bin/mobytest @@ -3,6 +3,7 @@ set -ex ifconfig +docker version docker info docker ps docker pull alpine @@ -12,3 +13,4 @@ wget -O - -q localhost/hostname docker kill webserver docker rm webserver docker swarm init +docker run mobylinux/check-config