Containers,  Microsoft

Standing up Portainer using Docker Desktop on Windows.

So as I find useful Docker tools… I’m finding that Portainer is a very useful for my running Docker Desktop…

The thing of it is… like a lot of images/containers… depending on what type of images you are set to run (Windows vs. Linux), the actual running of the Portainer varies.

If one is on windows images…

#
#First time running Portainer
#
#Now make sure that the directory C:\ProgramData\Portainer exist or change the second volume property (-v) below 
#
docker run -d -p 9000:9000 --name portainer --restart always -v "\\.\pipe\docker_engine:\\.\pipe\docker_engine" -v C:\ProgramData\Portainer:C:\data portainer/portainer
#
#

This gives one access to Portainer on Localhost:9000. In the first go around you will need set an admin user and password.

Now onto the Linux version…

#
# Do volume if one does not exist
#
docker volume create portainer_data
#
#Now start the image
#
docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

The key to doing this is to choose the type of containers before executing the RUN or PULL of the portainer image.

Because you got it, if you are running Windows containers – The RUN or PULL will get you that type of image for the OS… And one must Run the container based on the type. Indeed- the volume property is different between Windows and Linux….

Be Happy with your Containers….

~SG

Leave a Reply