Zack Williams | 3c5a85f | 2016-04-19 15:53:54 -0700 | [diff] [blame] | 1 | FROM xosproject/xos-synchronizer-openstack |
Scott Baker | c87cb60 | 2016-06-01 17:49:07 -0700 | [diff] [blame] | 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 | |
Zack Williams | 3c5a85f | 2016-04-19 15:53:54 -0700 | [diff] [blame] | 10 | # This container must be started in privileged mode. |
Scott Baker | 9765b86 | 2016-06-01 23:04:07 -0700 | [diff] [blame] | 11 | |
Zack Williams | 3c5a85f | 2016-04-19 15:53:54 -0700 | [diff] [blame] | 12 | # Install docker |
| 13 | ENV DOCKER_URL https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 |
| 14 | ENV DOCKER_SHA256 d0df512afa109006a450f41873634951e19ddabf8c7bd419caeb5a526032d86d |
Scott Baker | 73b0d95 | 2016-06-01 23:52:06 -0700 | [diff] [blame] | 15 | |
Zack Williams | 3c5a85f | 2016-04-19 15:53:54 -0700 | [diff] [blame] | 16 | RUN curl -fLsS $DOCKER_URL -o docker && \ |
| 17 | echo "${DOCKER_SHA256} docker" | sha256sum -c - && \ |
| 18 | mv docker /usr/local/bin/docker && \ |
| 19 | chmod +x /usr/local/bin/docker |
Scott Baker | 2cbf524 | 2016-06-14 01:07:54 -0700 | [diff] [blame] | 20 | |
Scott Baker | 73b0d95 | 2016-06-01 23:52:06 -0700 | [diff] [blame] | 21 | # XXX uncomment the following 6 lines to run docker-in-docker |
| 22 | # comment them out if using the docker socket in a volume instead |
| 23 | #ENV DIND_COMMIT=3b5fac462d21ca164b3778647420016315289034 |
Zack Williams | 3c5a85f | 2016-04-19 15:53:54 -0700 | [diff] [blame] | 24 | #RUN wget "https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind" -O /usr/local/bin/dind && chmod +x /sr/local/bin/dind |
Scott Baker | 73b0d95 | 2016-06-01 23:52:06 -0700 | [diff] [blame] | 25 | #COPY start-dockerd.sh /usr/local/bin/ |
| 26 | #VOLUME /var/lib/docker |
| 27 | #EXPOSE 2375 |
| 28 | #ENTRYPOINT ["start-dockerd.sh"] |
| 29 | |
| 30 | # Instead of using docker-in-docker, we can just attach ourselves |
| 31 | # to the docker socket via a volume in the docker-compose: |
| 32 | # - /var/run/docker.sock:/var/run/docker.sock |
| 33 | # This is more convenient, allowing us to build directly into our |
| 34 | # parent's docker build system, making the images available for |
Zack Williams | 3c5a85f | 2016-04-19 15:53:54 -0700 | [diff] [blame] | 35 | # instantiation on the parent. |
Scott Baker | c87cb60 | 2016-06-01 17:49:07 -0700 | [diff] [blame] | 36 | |
Zack Williams | 3c5a85f | 2016-04-19 15:53:54 -0700 | [diff] [blame] | 37 | # Install docker-compose |
| 38 | ENV DOCKER_COMPOSE_URL https://github.com/docker/compose/releases/download/1.5.2/docker-compose-Linux-x86_64 |
| 39 | ENV DOCKER_COMPOSE_SHA256 b6b975badc5389647ef1c16fe8a33bdc5935c61f6afd5a15a28ff765427d01e3 |
Scott Baker | 003d358 | 2016-06-07 10:24:44 -0700 | [diff] [blame] | 40 | |
Zack Williams | 3c5a85f | 2016-04-19 15:53:54 -0700 | [diff] [blame] | 41 | RUN curl -fLsS $DOCKER_COMPOSE_URL -o docker-compose && \ |
| 42 | echo "${DOCKER_COMPOSE_SHA256} docker-compose" | sha256sum -c - && \ |
| 43 | mv docker-compose /usr/local/bin/docker-compose && \ |
| 44 | chmod +x /usr/local/bin/docker-compose |
Scott Baker | 003d358 | 2016-06-07 10:24:44 -0700 | [diff] [blame] | 45 | |
Zack Williams | 3c5a85f | 2016-04-19 15:53:54 -0700 | [diff] [blame] | 46 | CMD /usr/bin/supervisord -c /etc/supervisor/conf.d/synchronizer.conf |