Docker Engine 安装/配置/使用
安装 Docker Engine
参考官方文档:官方文档(Ubuntu)
配置代理
由于 Docker 的守护进程不走系统代理,按官方文档的方法安装完后,会发现sudo docker run hello-world
连接超时。
同样参考官方文档:官方文档
注意!后来发现在其他设备按照官方文档的方法配置没能成功,问GPT后解决:
官方文档写法:
[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"
实际上在第二项Environment="HTTPS_PROXY=https://proxy.example.com:3129"
这里,如果使用Clash的局域网代理,要把https
改成http
,例如:
[Service]
Environment="HTTP_PROXY=http://192.168.0.104:7897"
Environment="HTTPS_PROXY=http://192.168.0.104:7897"
Environment="NO_PROXY=localhost,127.0.0.1"
至于如何配置系统代理,参考Ubuntu Server 静态IP与网络代理设置