Scott Baker | c87cb60 | 2016-06-01 17:49:07 -0700 | [diff] [blame] | 1 | FROM xosproject/xos-synchronizer-openstack |
| 2 | |
Scott Baker | 9765b86 | 2016-06-01 23:04:07 -0700 | [diff] [blame] | 3 | # Install docker-in-docker (dind). See https://hub.docker.com/_/docker/. The docker git repo |
| 4 | # currently only has 1.10 and 1.11, but it's possible to get the dockerfiles for earlier |
| 5 | # versions by using: |
| 6 | # docker pull centurylink/dockerfile-from-image |
| 7 | # alias dfimage="docker run -v /var/run/docker.sock:/var/run/docker.sock --rm centurylink/dockerfile-from-image" |
| 8 | # dgimage <name of image> |
| 9 | |
| 10 | # This container must be started in privileged mode. |
| 11 | |
Scott Baker | 066a301 | 2016-06-09 22:00:33 -0700 | [diff] [blame] | 12 | RUN apt-get install -y curl |
| 13 | # iptables |
Scott Baker | 9765b86 | 2016-06-01 23:04:07 -0700 | [diff] [blame] | 14 | ENV DOCKER_BUCKET=get.docker.com |
| 15 | ENV DOCKER_VERSION=1.8.3 |
| 16 | ENV DOCKER_SHA256=f024bc65c45a3778cf07213d26016075e8172de8f6e4b5702bedde06c241650f |
| 17 | RUN curl -fSL "https://${DOCKER_BUCKET}/builds/Linux/x86_64/docker-$DOCKER_VERSION" -o /usr/local/bin/docker && echo "${DOCKER_SHA256} /usr/local/bin/docker" | sha256sum -c - && chmod +x /usr/local/bin/docker |
Scott Baker | 73b0d95 | 2016-06-01 23:52:06 -0700 | [diff] [blame] | 18 | |
| 19 | # XXX uncomment the following 6 lines to run docker-in-docker |
| 20 | # comment them out if using the docker socket in a volume instead |
| 21 | #ENV DIND_COMMIT=3b5fac462d21ca164b3778647420016315289034 |
| 22 | #RUN wget "https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind" -O /usr/local/bin/dind && chmod +x /usr/local/bin/dind |
| 23 | #COPY start-dockerd.sh /usr/local/bin/ |
| 24 | #VOLUME /var/lib/docker |
| 25 | #EXPOSE 2375 |
| 26 | #ENTRYPOINT ["start-dockerd.sh"] |
| 27 | |
| 28 | # Instead of using docker-in-docker, we can just attach ourselves |
| 29 | # to the docker socket via a volume in the docker-compose: |
| 30 | # - /var/run/docker.sock:/var/run/docker.sock |
| 31 | # This is more convenient, allowing us to build directly into our |
| 32 | # parent's docker build system, making the images available for |
| 33 | # instantiation on the parent. |
Scott Baker | c87cb60 | 2016-06-01 17:49:07 -0700 | [diff] [blame] | 34 | |
Scott Baker | 003d358 | 2016-06-07 10:24:44 -0700 | [diff] [blame] | 35 | # Now install docker-compose |
| 36 | |
| 37 | RUN bash -c "curl -L https://github.com/docker/compose/releases/download/1.5.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose" |
| 38 | RUN chmod +x /usr/local/bin/docker-compose |
| 39 | |
Scott Baker | c87cb60 | 2016-06-01 17:49:07 -0700 | [diff] [blame] | 40 | CMD update-ca-certificates && /usr/bin/supervisord -c /etc/supervisor/conf.d/synchronizer.conf |