Bug 51033 - Docker does not consider proxy settings until manual intervention
Docker does not consider proxy settings until manual intervention
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: App Center
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-2-errata
Assigned To: Juan Pedro Torres
Philipp Hahn
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-03-27 17:54 CET by Valentin Heidelberger
Modified: 2022-07-28 09:11 CEST (History)
11 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.171
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Valentin Heidelberger univentionstaff 2020-03-27 17:54:49 CET
ucr set proxy/https="http://foo.bar:3128"

UCR writes the proxy settings to etc/systemd/system/docker.service.d/http-proxy.conf but they're not being considered until:

systemctl daemon-reload
systemctl restart docker


This lets installation of apps fail, if the app center's Docker repository is not reachable without a proxy from the UCS system.
Comment 1 Ingo Steuwer univentionstaff 2020-03-30 12:59:34 CEST
mhm, can we merge this with Bug #51031 ? In the end both need to be fixed to have proper proxy configuration in docker apps, right?
Comment 2 Valentin Heidelberger univentionstaff 2020-03-30 14:52:27 CEST
(In reply to Ingo Steuwer from comment #1)
> mhm, can we merge this with Bug #51031 ? In the end both need to be fixed to
> have proper proxy configuration in docker apps, right?

Maybe but technically they are different problems. This one concerns the docker daemon itself, bug #51031 is about the settings inside the containers.
Comment 3 Arvid Requate univentionstaff 2020-04-02 13:57:27 CEST
A Ticket-Number is required to qualify a Bug as "School Customer Affected".

I've pushed this Bug into the appcenter Taiga Backlog.
Comment 4 Nico Gulden univentionstaff 2020-04-20 16:50:54 CEST
We have the policy that services are not restarted automatically per default. This would be the wrong expectation for the Docker service, as well.

Restarting the Docker service would affect running Docker containers and therefore apps.

We'd rather think of a way to notify the administrator to restart the Docker service on their own after they changed the respective UCR variables. See bug #51125.
Comment 7 Arvid Requate univentionstaff 2022-04-06 15:55:22 CEST
> Restarting the Docker service would affect running Docker containers and therefore apps.

I don't see how it would. Even if you stop the docker process the running containers remain functional,
only the docker-cli cannot talk to the daemon while it's not there.

So from my POV I'd say that we should restart that service.
Comment 9 Juan Pedro Torres univentionstaff 2022-07-07 11:51:42 CEST
Docker daemon will be restarted on proxy changes. 

univention-docker.yaml
325342571b38 | Bug #51033: update advisory
661cdfccc93d | Bug #51033: added docker daemon restart module on proxy changes

univention-docker (5.0.2-2)
661cdfccc93d | Bug #51033: added docker daemon restart module on proxy changes


Package: univention-docker
Version: 5.0.2-2A~5.0.0.202207071107
Branch: ucs_5.0-0
Scope: errata5.0-2
Comment 10 Philipp Hahn univentionstaff 2022-07-27 17:07:17 CEST
OK: 661cdfccc93d
OK: 325342571b38

OK: errata-announce -V --only univention-docker.yaml
OK: univention-docker.yaml

OK: apt -t apt install univention-docker  # 5.0.2-2A~5.0.0.202207071107
OK: ucr set proxy/http{,s}=http://10.200.17.34:3128
OK: xargs -0n1 -a /proc/$(pidof dockerd)/environ echo
OK:
 iptables -A OUTPUT -d 10.200.0.0/16 -j ACCEPT
 iptables -A OUTPUT -d 10.205.0.0/16 -j ACCEPT
 iptables -A OUTPUT -d 192.168.0.0/8 -j ACCEPT
 iptables -A OUTPUT -j REJECT
 docker pull busybox
OK:
 docker run -d --name sleeper busybox sleep 1h
 ucr set proxy/http{,s}=http://10.200.17.34:3128
 docker ps  # still running

OK: dpkg -L univention-docker | grep restart
 /etc/univention/templates/modules/docker-daemon-restart.py
OK: grep -nH restart /etc/univention/templates/info/univention-docker.info
 /etc/univention/templates/info/univention-docker.info:22:Postinst: docker-daemon-restart.py

FYI: This fixes only the case for `dockerd`, e.g. downloading images from a registry via a proxy. It does NOT fix the use of the proxy from within a container, which requires https://docs.docker.com/network/proxy/
IGN: docker run --rm busybox:latest env | grep -i proxy