Portainer is a lightweight management UI which allows you to easily manage your different Docker environments (Docker hosts or Swarm clusters).
Basically it is a web based docker management service.
If you install portainer in linux then connecting to all running dockers is easy as it will take all local dockers in local environments.
But what if you choose to run portainer inside a container. Then portainer container has to communicate with other containers to manage them.
The detail procedure to accomplish this is as follows:
Install Portainer Docker
1. Use command
Code: Select all
docker pull portainer/portainer-ce
Code: Select all
docker create -p 8000:8000 -p 9443:9443 -v /var/run/docker.sock:/var/run/docker.sock --name portainer portainer/portainer-ce
docker.sock is exposed to container running portainer.So that host docker socket is shared to portainer container.
Now start docker container:
Code: Select all
docker start portainer
Set password for admin login and also can create users.
5. Now you can see there is two options get started with local environments and another add environments to add remote docker hosts.
6. Select local environments.
All docker containers and images will be seen in portainer now.
Its an easy and clean way to containerize each application. Even the portainer ui can be reverse proxied like nginx to controll all othe containers.
Please feel free to comment on the topic.
Thanks
Admin.