Portainer
Portainer
Architecture
Installation
Standalone
Install Portainer with Docker on Linux
docker volume create portainer_data
docker run -d -p 8000:8000 -p 9000:9000 -p 9443:9443 --name portainer \
--restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
portainer/portainer-ce:2.11.1
Swarm
!!! Attention Information
Pensez à activer docker swarm docker swarm init
Install Portainer with Docker Swarm on Linux
version: '3.2'
services:
agent:
image: portainer/agent:2.11.1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes
networks:
- agent_network
deploy:
mode: global
placement:
constraints: [ node.platform.os == linux ]
portainer:
image: portainer/portainer-ce:2.11.1
command: -H tcp://tasks.agent:9001 --tlsskipverify
ports:
- "9443:9443"
- "9000:9000"
- "8000:8000"
volumes:
- portainer_data:/data
networks:
- agent_network
deploy:
mode: replicated
replicas: 1
placement:
constraints: [ node.role == manager ]
networks:
agent_network:
driver: overlay
attachable: true
volumes:
portainer_data:
curl -L https://downloads.portainer.io/portainer-agent-stack.yml \
-o portainer-agent-stack.yml
docker stack deploy -c portainer-agent-stack.yml portainer
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
59ee466f6b15 portainer/agent:2.11.1 "./agent" About a minute ago Up About a minute portainer_agent.xbb8k6r7j1tk9gozjku7e43wr.5sa6b3e8cl6hyu0snlt387sgv
2db7dd4bfba0 portainer/portainer-ce:2.11.1 "/portainer -H tcp:/…" About a minute ago Up About a minute 8000/tcp, 9000/tcp, 9443/tcp portainer_portainer.1.gpuvu3pqmt1m19zxfo44v7izx
!!! Accès à portainer
On y accède ensuite via http://<server_url>:9000
ou https://<server_url>:9443