linux
September 28, 2023
Docker - шпаргалка
/etc/systemd/system/docker.service.d/http-proxy.conf
[Service] Environment="HTTP_PROXY=http://proxy.example.com:3128" Environment="HTTPS_PROXY=https://proxy.example.com:3129" Environment="NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"
$ sudo systemctl daemon-reload $ sudo systemctl restart docker
$ sudo systemctl show --property=Environment docker Environment=HTTP_PROXY=http://proxy.example.com:3128 HTTPS_PROXY=https://proxy.example.com:3129 NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp
По умолчанию демон слушает Unix-socket. Для подключения по сети, требуется включить прослушивание порта:
sudo systemctl edit docker.service
[Service] ExecStart= ExecStart=/usr/bin/dockerd -H fd:// -H tcp://127.0.0.1:2375
sudo systemctl daemon-reload
sudo systemctl restart docker.service
sudo netstat -lntp | grep dockerd tcp 0 0 127.0.0.1:2375 0.0.0.0:* LISTEN 3758/dockerd
https://docs.docker.com/config/daemon/remote-access/
https://docs.docker.com/engine/reference/run/
https://docs.docker.com/compose/reference/
https://docs.docker.com/engine/reference/commandline/dockerd/