From 653c4aad549a5b5d3fc562a901916d8080f2097e Mon Sep 17 00:00:00 2001 From: Stan Yagolnitser Date: Wed, 12 Dec 2018 00:42:40 -0800 Subject: [PATCH] added route for quicker docker engine setup, just curl /setup | bash --- nginx.conf | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/nginx.conf b/nginx.conf index c0787d5..69f5ff3 100644 --- a/nginx.conf +++ b/nginx.conf @@ -121,6 +121,28 @@ http { alias /ca/ca.crt; } + location /setup { + add_header "Content-type" "text/plain" always; + return 200 ' +mkdir -p /etc/systemd/system/docker.service.d +cat << EOD > /etc/systemd/system/docker.service.d/http-proxy.conf +[Service] +Environment="HTTPS_PROXY=$scheme://$http_host/" +EOD + +# Get the CA certificate from the proxy and make it a trusted root. +curl $scheme://$http_host/ca.crt > /usr/share/ca-certificates/docker_registry_proxy.crt +echo "docker_registry_proxy.crt" >> /etc/ca-certificates.conf +update-ca-certificates --fresh + +# Reload systemd +systemctl daemon-reload + +# Restart dockerd +systemctl restart docker.service +'; + } + # @TODO: add a dynamic root path that generates instructions for usage on docker clients }