Managing Containers with Portainer

I’ve detailed how to get Portainer and a Portainer Edge agent installed on two separate hosts, but now what?

To add containers, I think using Stacks is the way to go. You can see an overview of Stacks here. Additionally, if you are cool with the defaults, there are pre-built Stacks labeled as App Templates. These are Docker Compose files for common open-source sites and services that Portainer put together for you. I have made a few of these myself!

These Stacks can be fairly generic and then you add in an ENV file to give your specific values. Of course you can also reference the standard environmental variables provided by Docker.

The trickiest thing was figuring out the volumes. Sometimes I need something pointed to a Docker location, or something on my Docker host, but mainly I’m trying to keep critical, persistent data on my NAS. Reading thru the official documentation gave me some hints but it was StackOverflow to the rescue!

o: addr=mediaserver,nfsvers=4,nolock,soft,rw

In the options, you need the IP (or DNS name) of the NAS server, the version of NFS used, “nolock,soft” helps with asynchronicity, and you want to allow read and write.

Once you have what is basically a Docker Compose file, you can just “add stack”, select or enter your details, add your environmental variables and values, and BANG, you have one or more containers!


Posted

in

by

Tags: