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 }