diff --git a/projects/compose/Makefile b/projects/compose/Makefile index a271f2efb..5387b0b41 100644 --- a/projects/compose/Makefile +++ b/projects/compose/Makefile @@ -3,9 +3,7 @@ ORG?=linuxkitprojects IMAGE=compose DEPS=image/Dockerfile docker-compose.yml image/waitfordocker.sh image/load-images-and-compose.sh -COMMON_IMAGES := \ - nginx:alpine \ - traefik +COMMON_IMAGES := $(shell awk '/image:/ {print $$2}' docker-compose.yml | sort | uniq) HASH?=$(shell git ls-tree HEAD -- ./image | awk '{print $$3}') @@ -32,7 +30,7 @@ run-dynamic: linuxkit run dist/compose-dynamic run-static: - linuxkit run dist/compose-static + linuxkit run -mem 2048 dist/compose-static clean: rm -rf image-cache diff --git a/projects/compose/compose-dynamic.yml b/projects/compose/compose-dynamic.yml index 89cb3a44b..489c18f63 100644 --- a/projects/compose/compose-dynamic.yml +++ b/projects/compose/compose-dynamic.yml @@ -20,14 +20,19 @@ onboot: image: linuxkit/mount:v0.6 command: ["/usr/bin/mountie", "/var/lib/docker"] services: + - name: getty + image: linuxkit/getty:v0.6 + env: + - INSECURE=true - name: rngd image: linuxkit/rngd:v0.6 - name: ntpd image: linuxkit/openntpd:v0.6 - name: docker - image: docker:17.07.0-ce-dind + image: docker:18.06.0-ce-dind capabilities: - all + net: host mounts: - type: cgroup options: ["rw","nosuid","noexec","nodev","relatime"] @@ -39,11 +44,13 @@ services: - /etc/html:/var/html command: ["/usr/local/bin/docker-init", "/usr/local/bin/dockerd"] - name: compose - image: linuxkitprojects/compose:0535e78608f57702745dfd56fbe78d28d237e469 + image: linuxkitprojects/compose:111f9f32a933c9e7acbf3ccfc13fedbdfce8224f binds: - /var/run:/var/run - /etc/compose:/compose files: + - path: var/lib/docker + directory: true - path: etc/html/a/index.html source: html-a.html - path: etc/html/b/index.html @@ -53,3 +60,4 @@ files: trust: org: - linuxkit + - library diff --git a/projects/compose/compose-static.yml b/projects/compose/compose-static.yml index a826f84b8..2d3de251f 100644 --- a/projects/compose/compose-static.yml +++ b/projects/compose/compose-static.yml @@ -20,14 +20,19 @@ onboot: image: linuxkit/mount:v0.6 command: ["/usr/bin/mountie", "/var/lib/docker"] services: + - name: getty + image: linuxkit/getty:v0.6 + env: + - INSECURE=true - name: rngd image: linuxkit/rngd:v0.6 - name: ntpd image: linuxkit/openntpd:v0.6 - name: docker - image: docker:17.07.0-ce-dind + image: docker:18.06.0-ce-dind capabilities: - all + net: host mounts: - type: cgroup options: ["rw","nosuid","noexec","nodev","relatime"] @@ -39,11 +44,13 @@ services: - /etc/html:/var/html command: ["/usr/local/bin/docker-init", "/usr/local/bin/dockerd"] - name: compose - image: linuxkitprojects/compose:0535e78608f57702745dfd56fbe78d28d237e469 + image: linuxkitprojects/compose:111f9f32a933c9e7acbf3ccfc13fedbdfce8224f binds: - /var/run:/var/run - /etc/compose:/compose files: + - path: var/lib/docker + directory: true - path: etc/html/a/index.html source: html-a.html - path: etc/html/b/index.html @@ -57,3 +64,4 @@ files: trust: org: - linuxkit + - library diff --git a/projects/compose/image/load-images-and-compose.sh b/projects/compose/image/load-images-and-compose.sh index d8a3e9456..574a8bac3 100755 --- a/projects/compose/image/load-images-and-compose.sh +++ b/projects/compose/image/load-images-and-compose.sh @@ -9,9 +9,11 @@ set -e [ -n "$DEBUG" ] && set -x -for image in /compose/images/*.tar ; do - docker image load -i $image && rm -f $image -done +if [ -d /compose/images/ ]; then + for image in /compose/images/*.tar ; do + docker image load -i $image + done +fi docker-compose -f /compose/docker-compose.yml up -d