mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-07-16 03:07:26 +08:00
Move daemon configuration to daemon.json file
This commit is contained in:
parent
be2761a6be
commit
4394be9cf2
@ -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
|
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)
|
# Install a nice vimrc file and prompt (by soulshake)
|
||||||
COPY ["docker-prompt","/usr/local/bin/"]
|
COPY ["docker-prompt","/usr/local/bin/"]
|
||||||
COPY [".vimrc",".bashrc", ".inputrc", ".gitconfig", "./root/"]
|
COPY [".vimrc",".bashrc", ".inputrc", ".gitconfig", "./root/"]
|
||||||
|
COPY ["daemon.json", "/etc/docker/"]
|
||||||
|
|
||||||
ARG docker_storage_driver=overlay2
|
ARG docker_storage_driver=overlay2
|
||||||
|
|
||||||
@ -34,8 +35,9 @@ WORKDIR /root
|
|||||||
# Remove IPv6 alias for localhost and start docker in the background ...
|
# Remove IPv6 alias for localhost and start docker in the background ...
|
||||||
CMD cat /etc/hosts >/etc/hosts.bak && \
|
CMD cat /etc/hosts >/etc/hosts.bak && \
|
||||||
sed 's/^::1.*//' /etc/hosts.bak > /etc/hosts && \
|
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 && \
|
umount /var/lib/docker && \
|
||||||
dockerd --experimental -g /graph --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 \
|
dockerd &>/docker.log & \
|
||||||
--storage-driver=$DOCKER_STORAGE_DRIVER --dns $PWD_IP_ADDRESS --dns 8.8.8.8 &>/docker.log & \
|
|
||||||
while true ; do script -q -c /bin/bash /dev/null ; done
|
while true ; do script -q -c /bin/bash /dev/null ; done
|
||||||
# ... and then put a shell in the foreground, restarting it if it exits
|
# ... and then put a shell in the foreground, restarting it if it exits
|
||||||
|
8
daemon.json
Normal file
8
daemon.json
Normal 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"]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user