diff --git a/1.11/dind-compose/Dockerfile b/1.11/dind-compose/Dockerfile new file mode 100644 index 000000000..88152620e --- /dev/null +++ b/1.11/dind-compose/Dockerfile @@ -0,0 +1,15 @@ +FROM docker:1.11-dind + +RUN apk add --no-cache \ + 'py-pip==8.1.2-r0' + +RUN set -x \ + && pip install 'docker-compose' + +COPY dockerd-entrypoint.sh /usr/local/bin/ + +VOLUME /var/lib/docker +EXPOSE 2375 + +ENTRYPOINT ["dockerd-entrypoint.sh"] +CMD [] diff --git a/1.11/dind-compose/dockerd-entrypoint.sh b/1.11/dind-compose/dockerd-entrypoint.sh new file mode 100755 index 000000000..95680bd4a --- /dev/null +++ b/1.11/dind-compose/dockerd-entrypoint.sh @@ -0,0 +1,21 @@ +#!/bin/sh +set -e + +# no arguments passed +# or first arg is `-f` or `--some-option` +if [ "$#" -eq 0 -o "${1#-}" != "$1" ]; then + # add our default arguments + set -- docker daemon \ + --host=unix:///var/run/docker.sock \ + --host=tcp://0.0.0.0:2375 \ + --storage-driver=vfs \ + "$@" +fi + +if [ "$1" = 'docker' -a "$2" = 'daemon' ]; then + # if we're running Docker, let's pipe through dind + # (and we'll run dind explicitly with "sh" since its shebang is /bin/bash) + set -- sh "$(which dind)" "$@" +fi + +exec "$@" diff --git a/1.12/dind-compose/Dockerfile b/1.12/dind-compose/Dockerfile new file mode 100644 index 000000000..f7f4ff514 --- /dev/null +++ b/1.12/dind-compose/Dockerfile @@ -0,0 +1,15 @@ +FROM docker:1.12-dind + +RUN apk add --no-cache \ + 'py-pip==8.1.2-r0' + +RUN set -x \ + && pip install 'docker-compose' + +COPY dockerd-entrypoint.sh /usr/local/bin/ + +VOLUME /var/lib/docker +EXPOSE 2375 + +ENTRYPOINT ["dockerd-entrypoint.sh"] +CMD [] diff --git a/1.12/dind-compose/dockerd-entrypoint.sh b/1.12/dind-compose/dockerd-entrypoint.sh new file mode 100755 index 000000000..95680bd4a --- /dev/null +++ b/1.12/dind-compose/dockerd-entrypoint.sh @@ -0,0 +1,21 @@ +#!/bin/sh +set -e + +# no arguments passed +# or first arg is `-f` or `--some-option` +if [ "$#" -eq 0 -o "${1#-}" != "$1" ]; then + # add our default arguments + set -- docker daemon \ + --host=unix:///var/run/docker.sock \ + --host=tcp://0.0.0.0:2375 \ + --storage-driver=vfs \ + "$@" +fi + +if [ "$1" = 'docker' -a "$2" = 'daemon' ]; then + # if we're running Docker, let's pipe through dind + # (and we'll run dind explicitly with "sh" since its shebang is /bin/bash) + set -- sh "$(which dind)" "$@" +fi + +exec "$@"