diff --git a/020_docker.sh b/020_docker.sh index fbe1f5a..312f83e 100755 --- a/020_docker.sh +++ b/020_docker.sh @@ -25,7 +25,7 @@ fi apt-get update apt-get -y install --force-yes jq -apt-get remove docker docker-engine docker.io containerd runc +apt-get remove -y docker docker-engine docker.io containerd runc apt-get install -y \ apt-transport-https \ ca-certificates \ @@ -39,13 +39,16 @@ apt-get install -y docker-ce docker-ce-cli containerd.io #umount /dev/mapper/vg_prime-varLibDockerLV #mount /dev/mapper/vg_prime-varLibDockerLV /var/lib/docker -bash -c 'perl -p -i -e "s/#DOCKER_OPTS=\"\"/DOCKER_OPTS=\"--restart=true\"/g" /etc/default/docker' -bash -c 'sed -i "s|DOCKER_OPTS=\"\(.*\)\"|DOCKER_OPTS=\"\1 --storage-driver=zfs\"|" /etc/default/docker' -bash -c 'sed -i "s|DOCKER_OPTS=\"\(.*\)\"|DOCKER_OPTS=\"\1 --dns 52.174.55.168 --dns 188.165.200.156\"|" /etc/default/docker' -bash -c 'sed -i "s|DOCKER_OPTS=\"\(.*\)\"|DOCKER_OPTS=\"\1 zfs.fsname=rpool/docker\"|" /etc/default/docker' +#bash -c 'perl -p -i -e "s/#DOCKER_RUN_OPTS=\"\"/DOCKER_RUN_OPTS=\"--restart=true\"/g" /etc/default/docker' +bash -c 'sed -i "s|DOCKER_RUN_OPTS=\"\(.*\)\"|DOCKER_RUN_OPTS=\"\1 --storage-driver=zfs\"|" /etc/default/docker' +bash -c 'sed -i "s|DOCKER_RUN_OPTS=\"\(.*\)\"|DOCKER_RUN_OPTS=\"\1 --dns 52.174.55.168 --dns 188.165.200.156\"|" /etc/default/docker' +bash -c 'sed -i "s|DOCKER_RUN_OPTS=\"\(.*\)\"|DOCKER_RUN_OPTS=\"\1 zfs.fsname=rpool/docker\"|" /etc/default/docker' + +# enable buildkit builds +bash -c 'sed -i "/^# Docker Upstart.*/ s/.*/&\nDOCKER_BUILDKIT=1/" /etc/default/docker' # i2p container requires ipv6 -bash -c 'sed -i "s|DOCKER_OPTS=\"\(.*\)\"|DOCKER_OPTS=\"\1 --ipv6\"|" /etc/default/docker' +bash -c 'sed -i "s|DOCKER_RUN_OPTS=\"\(.*\)\"|DOCKER_RUN_OPTS=\"\1 --ipv6\"|" /etc/default/docker' # The above can also be passed in /etc/docker/daemon.json # For other options: @@ -64,6 +67,106 @@ fi # FIXME: Should be on the same dataset as the docker rpool (/var/lib/docker) TLS_HOME=/var/docker +## Default configuration file on linux: +## /etc/docker/daemon.json +# Note: You cannot set options in daemon.json that have already been set on daemon startup as +# a flag in /etc/default/docker the docker daemon will refuse to start. +# +## https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file +## This is a full example of the allowed configuration options on Linux: +#{ +# "authorization-plugins": [], +# "data-root": "", +# "dns": [], +# "dns-opts": [], +# "dns-search": [], +# "exec-opts": [], +# "exec-root": "", +# "experimental": false, +# "features": {}, +# "storage-driver": "", +# "storage-opts": [], +# "labels": [], +# "live-restore": true, +# "log-driver": "json-file", +# "log-opts": { +# "max-size": "10m", +# "max-file":"5", +# "labels": "somelabel", +# "env": "os,customer" +# }, +# "mtu": 0, +# "pidfile": "", +# "cluster-store": "", +# "cluster-store-opts": {}, +# "cluster-advertise": "", +# "max-concurrent-downloads": 3, +# "max-concurrent-uploads": 5, +# "default-shm-size": "64M", +# "shutdown-timeout": 15, +# "debug": true, +# "hosts": [], +# "log-level": "", +# "tls": true, +# "tlsverify": true, +# "tlscacert": "", +# "tlscert": "", +# "tlskey": "", +# "swarm-default-advertise-addr": "", +# "api-cors-header": "", +# "selinux-enabled": false, +# "userns-remap": "", +# "group": "", +# "cgroup-parent": "", +# "default-ulimits": { +# "nofile": { +# "Name": "nofile", +# "Hard": 64000, +# "Soft": 64000 +# } +# }, +# "init": false, +# "init-path": "/usr/libexec/docker-init", +# "ipv6": false, +# "iptables": false, +# "ip-forward": false, +# "ip-masq": false, +# "userland-proxy": false, +# "userland-proxy-path": "/usr/libexec/docker-proxy", +# "ip": "0.0.0.0", +# "bridge": "", +# "bip": "", +# "fixed-cidr": "", +# "fixed-cidr-v6": "", +# "default-gateway": "", +# "default-gateway-v6": "", +# "icc": false, +# "raw-logs": false, +# "allow-nondistributable-artifacts": [], +# "registry-mirrors": [], +# "seccomp-profile": "", +# "insecure-registries": [], +# "no-new-privileges": false, +# "default-runtime": "runc", +# "oom-score-adjust": -500, +# "node-generic-resources": ["NVIDIA-GPU=UUID1", "NVIDIA-GPU=UUID2"], +# "runtimes": { +# "cc-runtime": { +# "path": "/usr/bin/cc-runtime" +# }, +# "custom": { +# "path": "/usr/local/bin/my-runc-replacement", +# "runtimeArgs": [ +# "--debug" +# ] +# } +# }, +# "default-address-pools":[ +# {"base":"172.80.0.0/16","size":24}, +# {"base":"172.90.0.0/16","size":24} +# ] +#} + #DOCKER_OPT[0]='.["dns"] = ["52.174.55.168","188.165.200.156"]' #DOCKER_OPT[1]='.["live-restore"] = true' #DOCKER_OPT[2]='.["storage-driver"] = "zfs"'