File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,28 @@ http {
121
121
alias /ca/ca.crt;
122
122
}
123
123
124
+ location /setup {
125
+ add_header "Content-type" "text/plain" always;
126
+ return 200 '
127
+ mkdir -p /etc/systemd/system/docker.service.d
128
+ cat << EOD > /etc/systemd/system/docker.service.d/http-proxy.conf
129
+ [Service]
130
+ Environment="HTTPS_PROXY=$scheme ://$http_host /"
131
+ EOD
132
+
133
+ # Get the CA certificate from the proxy and make it a trusted root.
134
+ curl $scheme ://$http_host /ca.crt > /usr/share/ca-certificates/docker_registry_proxy.crt
135
+ echo "docker_registry_proxy.crt" >> /etc/ca-certificates.conf
136
+ update-ca-certificates --fresh
137
+
138
+ # Reload systemd
139
+ systemctl daemon-reload
140
+
141
+ # Restart dockerd
142
+ systemctl restart docker.service
143
+ ' ;
144
+ }
145
+
124
146
# @TODO: add a dynamic root path that generates instructions for usage on docker clients
125
147
}
126
148
You can’t perform that action at this time.
0 commit comments