added route for quicker docker engine setup, just curl /setup | bash
parent
a89cf362ad
commit
653c4aad54
22
nginx.conf
22
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue