系統(tǒng):Centos
docker:23.0.6
portainer:2.19.2
服務(wù)器A and 服務(wù)器B
A,B都有Docker
現(xiàn)象
1、在A上安裝了Portainer后,local evironment 可以顯示images數(shù)量等信息,但無法顯示詳情,出現(xiàn)Unable to connect to the Docker environment
2、嘗試
????????編輯docker.service
vim /usr/lib/systemd/system/docker.service
????????找到 ExecStart字段修改如下
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
? ? ? ? 重啟docker
systemctl daemon-reload
systemctl restart docker
此方法對(duì)我無效,還是一樣無法查看詳情
3、也嘗試了重新部署portianer,仍然報(bào)錯(cuò)
解決
把local和遠(yuǎn)程的docker都當(dāng)作遠(yuǎn)程來連
在部署docker的服務(wù)器上啟動(dòng)容器
docker run -d \
? -p 9001:9001 \
? --name portainer_agent \
? --restart=always \
? -v /var/run/docker.sock:/var/run/docker.sock \
? -v /var/lib/docker/volumes:/var/lib/docker/volumes \
? portainer/agent:2.19.2
然后在portainer上配置docker-agent,ip:9001文章來源:http://www.zghlxwxcb.cn/news/detail-849609.html
成功連接!文章來源地址http://www.zghlxwxcb.cn/news/detail-849609.html
到了這里,關(guān)于Portainer連不上docker Unable to retrieve images或Unable to connect to the Docker environment的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!