Update systemd.md

Systemctl requires different escape characters than a URL does so a proxy var with special URL characters needs to have them escaped with the hex equivalent and the systemctl escapes.

A backslash in domain\user becomes domain%5Cuser but this breaks systemctl because of the % sign.

If you need to use systemctl with a url and special chars is domain%%5Cuser (Notice the DOUBLE %).

[Service]
Environment="HTTP_PROXY=http://domain%%5Cuser:complex%%23pass@proxy.example.com:8080/"
This commit is contained in:
Kenneth Fortner 2020-11-04 16:51:50 -06:00
parent cfe28ef08f
commit a1661fd876
1 changed files with 14 additions and 0 deletions

View File

@ -111,6 +111,13 @@ you need to add this configuration in the Docker systemd service file.
Environment="HTTP_PROXY=http://proxy.example.com:80" Environment="HTTP_PROXY=http://proxy.example.com:80"
Environment="HTTPS_PROXY=https://proxy.example.com:443" Environment="HTTPS_PROXY=https://proxy.example.com:443"
``` ```
If you have to use special characters in the proxy value they must be both URL encoded and escape the % signs with double %%.
```
[Service]
Environment="HTTP_PROXY=http://domain%%5Cuser:complex%%23pass@proxy.example.com:8080/"
```
3. If you have internal Docker registries that you need to contact without 3. If you have internal Docker registries that you need to contact without
proxying you can specify them via the `NO_PROXY` environment variable. proxying you can specify them via the `NO_PROXY` environment variable.
@ -187,6 +194,13 @@ you need to add this configuration in the Docker systemd service file.
Environment="HTTP_PROXY=http://proxy.example.com:80" Environment="HTTP_PROXY=http://proxy.example.com:80"
Environment="HTTPS_PROXY=https://proxy.example.com:443" Environment="HTTPS_PROXY=https://proxy.example.com:443"
``` ```
If you have to use special characters in the proxy value they must be both URL encoded and escape the % signs with double %%.
```
[Service]
Environment="HTTP_PROXY=http://domain%%5Cuser:complex%%23pass@proxy.example.com:8080/"
```
3. If you have internal Docker registries that you need to contact without 3. If you have internal Docker registries that you need to contact without
proxying, you can specify them via the `NO_PROXY` environment variable. proxying, you can specify them via the `NO_PROXY` environment variable.