1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-07-15 10:47:26 +08:00

Move daemon configuration to daemon.json file

This commit is contained in:
Marcos Lilljedahl 2017-03-06 22:55:57 -03:00
parent be2761a6be
commit 4394be9cf2
2 changed files with 13 additions and 3 deletions

View File

@ -1,4 +1,4 @@
FROM docker:17.03.0-ce-rc1-dind
FROM docker:17.03.0-ce-dind
RUN apk add --no-cache git tmux py2-pip apache2-utils vim build-base gettext-dev curl bash util-linux
@ -23,6 +23,7 @@ RUN rm /sbin/modprobe && echo '#!/bin/true' >/sbin/modprobe && chmod +x /sbin/mo
# Install a nice vimrc file and prompt (by soulshake)
COPY ["docker-prompt","/usr/local/bin/"]
COPY [".vimrc",".bashrc", ".inputrc", ".gitconfig", "./root/"]
COPY ["daemon.json", "/etc/docker/"]
ARG docker_storage_driver=overlay2
@ -34,8 +35,9 @@ WORKDIR /root
# Remove IPv6 alias for localhost and start docker in the background ...
CMD cat /etc/hosts >/etc/hosts.bak && \
sed 's/^::1.*//' /etc/hosts.bak > /etc/hosts && \
sed -i "s/\DOCKER_STORAGE_DRIVER/$DOCKER_STORAGE_DRIVER/" /etc/docker/daemon.json && \
sed -i "s/\PWD_IP_ADDRESS/$PWD_IP_ADDRESS/" /etc/docker/daemon.json && \
umount /var/lib/docker && \
dockerd --experimental -g /graph --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 \
--storage-driver=$DOCKER_STORAGE_DRIVER --dns $PWD_IP_ADDRESS --dns 8.8.8.8 &>/docker.log & \
dockerd &>/docker.log & \
while true ; do script -q -c /bin/bash /dev/null ; done
# ... and then put a shell in the foreground, restarting it if it exits

8
daemon.json Normal file
View File

@ -0,0 +1,8 @@
{
"experimental": true,
"graph": "/graph",
"insecure-registries": ["127.0.0.1"],
"hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"],
"storage-driver": "DOCKER_STORAGE_DRIVER",
"dns": ["PWD_IP_ADDRESS", "8.8.8.8"]
}