2.4 KiB
portainer-docker
Portainer Community Edition is a lightweight service delivery platform for containerized applications that can be used to manage docker, Swarm, Kubernetes and ACI environments. It is designed to be as simple to deploy as it is to use. The application allows you to manage all your orchestrator resources (containers, images, volumes, networks and more) through a ‘smart’ GUI and/or an extensive API.
Portainer consists of a single container that can run on any cluster. It can be deployed as a Linux container or a Windows native container.
This container is deployed to oversee all deployed docker containers. You can create the container with the following commands:
docker volume create portainer_data
docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
Multiple server
Portainer can be used to manage multiple instances of docker (servers). For that to be possible a second portainer container has to be deployed on the machine that is added to the main portainer manager. root priv. needed (sudo).
sudo 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
For that to work, the port has to be accessible from the main portainer instance. After the conatiner is spawnd, access the additional instance through the portainer GUI on port 9000 and add it via the environment tab as a swarm instance.
Stacks
Portainer has a feature for controlling Docker Stacks (multiple containers that act as a complementary unit). To do that, the containers need to be started as a stack inside the portainer UI. This must be done as a docker compose file. Thzis file can be either created in portainer or imported from different sources. you can controll all containers in a stack at the same time to stop/start the whole unit.