From 4394be9cf25fb3eda86784ab4c955a7f662826c7 Mon Sep 17 00:00:00 2001 From: Marcos Lilljedahl Date: Mon, 6 Mar 2017 22:55:57 -0300 Subject: [PATCH] Move daemon configuration to daemon.json file --- Dockerfile.dind | 8 +++++--- daemon.json | 8 ++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 daemon.json diff --git a/Dockerfile.dind b/Dockerfile.dind index 556636f..098e45f 100644 --- a/Dockerfile.dind +++ b/Dockerfile.dind @@ -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 diff --git a/daemon.json b/daemon.json new file mode 100644 index 0000000..0aaebca --- /dev/null +++ b/daemon.json @@ -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"] +}