Docker kann innerhalb des LXC-Containers nicht auf das Internet zugreifen

Docker kann innerhalb des LXC-Containers nicht auf das Internet zugreifen

Ich habe einen Ubuntu 20.04 LXC-Container auf RedHat 8.6 mit dem folgenden Befehl gestartet

lxc launch ubuntu:20.04 --storage default -c security.privileged=true -c boot.autostart=true --network lxdbr0

Ich habe Docker im Container installiert, meine Netzwerk-Proxy-Einstellungen konfiguriert /etc/systemd/system/docker.service.d/http-proxy.confund dann den Docker-Dienst neu gestartet.


[Service]
Environment="HTTP_PROXY=<proxy address redacted>"
Environment="HTTPS_PROXY=<proxy address redacted>"

Beim Versuch, ein Bild abzurufen, wird ein TLS-Handshake-Timeoutfehler angezeigt.

root@still-katydid:~# docker pull nginx
Using default tag: latest
Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: TLS handshake timeout

Beim Betrachten /var/log/syslogkann ich einige Fehler sehen

Dec  8 11:57:36 still-katydid dockerd[9606]: time="2022-12-08T11:57:36.486272382Z" level=warning msg="Your kernel does not support cgroup blkio weight"
Dec  8 11:57:36 still-katydid dockerd[9606]: time="2022-12-08T11:57:36.486290117Z" level=warning msg="Your kernel does not support cgroup blkio weight_device"
Dec  8 11:57:36 still-katydid dockerd[9606]: time="2022-12-08T11:57:36.487001498Z" level=info msg="Loading containers: start."
Dec  8 11:57:36 still-katydid dockerd[9606]: time="2022-12-08T11:57:36.489111401Z" level=warning msg="Running modprobe bridge br_netfilter failed with message: modprobe: WARNING: Module bridge not found in directory /lib/modules/4.18.0-372.9.1.el8.x86_64\nmodprobe: WARNING: Module br_netfilter not found in directory /lib/modules/4.18.0-372.9.1.el8.x86_64\n, error: exit status 1"
Dec  8 11:57:36 still-katydid dockerd[9606]: time="2022-12-08T11:57:36.591405424Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address"

Ich weiß, dass die Proxy-Adresseinstellungen korrekt sind, da ich sie auch in meiner .bashrcDatei konfiguriert habe und ich Adressen wiehttps://www.bbc.co.ukerfolgreich.

Die Firewall ist sowohl auf dem Host als auch im Container deaktiviert.

Ich habe den Container und den Host mehrmals neu gestartet.

Antwort1

!Ich habe mein Problem gelöst. Mein Passwort enthielt ein Sonderzeichen . Ich hatte es bereits mit maskiert %21, aber es stellte sich heraus, dass Docker ein doppeltes erfordert %%.

Für Docker-Proxy-Passwörter !muss also ein Zeichen maskiert werden mit%%21

Weitere Infos gibt es hierhttps://docs.docker.com/config/daemon/systemd/

verwandte Informationen