Build containerd containers from Docker containers

Simplifies the build process, and makes testing easier as there is a
Docker container you can run to test things.

Replaces #994

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack
2017-01-15 22:50:21 +00:00
parent 6076d70996
commit 7ae11bc5d4
19 changed files with 197 additions and 93 deletions

5
alpine/base/rngd/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
bin
dev
proc
sys
usr

View File

@@ -0,0 +1,3 @@
FROM scratch
COPY . ./
CMD ["/bin/tini", "/usr/sbin/rngd", "-f"]

53
alpine/base/rngd/Makefile Normal file
View File

@@ -0,0 +1,53 @@
# Tag: b6aed437bad8f1f4471b11f1affe3420eaf5d42f
RNG_TOOLS_IMAGE=mobylinux/rng-tools@sha256:8e74e6a39b072ebee65ee4b83ebf224787afb473ea250c897dd24fa43b387d06
RNGD_BINARY=usr/sbin/rngd
# Tag 6b25b62f4d893de8721fd2581411039b17e8a253
TINI_IMAGE=mobylinux/tini@sha256:39b4a459018ffc155a9fcbbf952fa625c77f5a8d7599b326eade529d3dc723fc
TINI_BINARY=bin/tini
.PHONY: tag push clean container
default: push
$(TINI_BINARY):
mkdir -p $(dir $@)
docker run --rm --net=none $(TINI_IMAGE) tar cf - $@ | tar xf -
$(RNGD_BINARY):
mkdir -p $(dir $@)
docker run --rm --net=none $(RNG_TOOLS_IMAGE) tar cf - $@ | tar xf -
SHA_IMAGE=alpine:3.5
IMAGE=rngd
DIRS=dev proc sys
$(DIRS):
mkdir -p $@
DEPS=$(DIRS) $(TINI_BINARY) $(RNGD_BINARY)
container: Dockerfile $(DEPS)
tar cf - $^ | docker build --no-cache -t $(IMAGE):build -
hash: Dockerfile $(DEPS)
DOCKER_CONTENT_TRUST=1 docker pull $(SHA_IMAGE)
tar cf - $^ | docker run --rm -i $(SHA_IMAGE) sha1sum - | sed 's/ .*//' > hash
push: hash container
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 container
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 $(DIRS) usr bin
.DELETE_ON_ERROR: