大网数据广告活动
服务器运维问答

Accessing different host's docker containers via portainer

· 52CE 我爱测

I have a few containers (running various services) on my ubuntu server and i manage those containers via portainer, which is also one of these containers. I would like to also manage a pihole container (running on a different ser…

问题原文

原帖链接 · Thefeli73 · CC BY-SA 4.0

I have a few containers (running various services) on my ubuntu server and i manage those containers via portainer, which is also one of these containers. I would like to also manage a pihole container (running on a different server (raspberry pi)) from that same portainer interface. The machines are on the same local, private, network.

I've read about people proxying/exposing the docker unix socket over tcp etc but that seems risky and unsecure and more like a workaround. I tried reading up on docker swarms but that seems like a different use case but i could be wrong.

Any help is very appreciated :)

已采纳解答

原帖链接 · Adarsha · CC BY-SA 4.0

You can deploy portainer/agent and access it via the agent url

  portainer_agent:
    image: portainer/agent
    container_name: portainer-agent
    ports:
    - "9001:9001"
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock
    - /var/lib/docker/volumes:/var/lib/docker/volumes
    restart: unless-stopped

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-01-31)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。