Ability to create environment variables/file for use in Docker containers


Recommended Posts

Similar to how you can create a .env file when using docker-compose, in other projects I would put a number of variables in here that I could use across a number of containers and reference them with ${VARIABLE_NAME}

 

I use Traefik as my reverse proxy, setting up all those labels was a bit time consuming, setting up new containers would be simplified if I could have label values stored as variables that I could reference. If I ever change my host, I have a LOT of containers to update vs updating a single variable

Also when testing mysql containers with predefined username and password. I'm sure there are plenty more use cases

 

A small section on the Docker tab to allow managing of variables, and then of course the ability to then use them when creating/editing a container

 

In addition, Docker also allows using a file with the --env-file option, I know I could do this up manually but a nice front end to create/manage them would be handy.. but perhaps asking to much now 

 

https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e-env-env-file

Edited by eldorado
Link to comment
  • 1 year later...

Hey bud, I am struggling to get Traefik 2 up and running on my unRAID install, how did you insert the environment variables. I get errors related to the ACME cert grab as it is trying to login with @gmail.com instead of [email protected].  I also cannot get the container's web interface up.  I have a separate docker network called 'proxynet' so all the containers that will go through the reverse proxy can communicate.  I also changed unraid's web interface away from 80 and 443, so that traefik can use those ports.  Could you please send me a photo of your docker-compose file and or what the web interface in unRAID to edit the container looks like.  Plus the container need traefik.yml.  Any help would be appreciated.  I tried getting nginx proxy man up and running with Atuthelia and have run into issues, so now I am looking at Traefik to handle reverse proxying and google Oauth instead of Authelia.  Any help just getting the traefik continer to show its interface would be much appreciated.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.