13 grudnia 2021

Portainer #3 - Portainer

Portainer

Uruchamiamy tymczasowego agenta z konsoli.

docker run -d -p 9005:9001 --name portainer_agent_temp --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:2.11.0

Następnie możemy uruchomić composer (stack)

version: "3.8"

services:
  app:
    container_name: portainer
    command: -H unix:///var/run/docker.sock
    image: cr.portainer.io/portainer/portainer-ce:2.11.0
    restart: unless-stopped
    volumes:
      - data:/data
      - /var/run/docker.sock:/var/run/docker.sock 
    ports:
      - "9000:9000"
      
volumes:
  data:
    driver: local
    name: portainer_data
version: "3.8"
services:
  agent:
    container_name: portainer_agent
    image: portainer/agent:2.11.0
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock 
      - /var/lib/docker/volumes:/var/lib/docker/volumes
    ports:
      - "9001:9001"

Lub jako jedna konfiguracja:

version: "3.8"

services:
  app:
    container_name: portainer
    command: -H unix:///var/run/docker.sock
    image: cr.portainer.io/portainer/portainer-ce:2.11.0
    restart: unless-stopped
    volumes:
      - data:/data
      - /var/run/docker.sock:/var/run/docker.sock 
    ports:
      - "9000:9000"
      
  agent:
    container_name: portainer_agent
    image: portainer/agent:2.11.0
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock 
      - /var/lib/docker/volumes:/var/lib/docker/volumes
    ports:
      - "9001:9001"
      
volumes:
  data:
    driver: local
    name: portainer_data