Resolve ENV vars in labels #9747
Replies: 5 comments
-
|
Hey, thanks for bringing this up. Just to understand where you are coming from, are you able to provide some more details on what you are trying to achieve? Also, could you please explain a little more why you are looking to use environment labels when you deploy a container? |
Beta Was this translation helpful? Give feedback.
-
|
Hey @mariyam-portainer . I was trying to create a Portainer container (type 1) template for an app behind the traefik reverse proxy, which uses labels as part of it's configuration. I cannot use a stack template because the app required access do devices that stacks do not support. I could not use a compose template because the docker engine is in swarm mode. |
Beta Was this translation helpful? Give feedback.
-
|
So to recap, you created your own copy of the templates.json and placed that into your git repo. But because docker service has no equivalent of And you want those values to be dynamic and provided when using the template, e.g. the template would contain something like: But there's no substitution happening, so you can't do something like: |
Beta Was this translation helpful? Give feedback.
-
|
Exactly correct @huib-portainer |
Beta Was this translation helpful? Give feedback.
-
|
For my specific situation it would also work if portainer displayed compose stacks in swarm mode when there are "attachable" overlay networks. Then I could use env substitution with the compose file. That, of course, is an entirely different feature request! But I think it would also make sense to add to portainer and add coverage to new use cases and keep the user from needing to leave the tool. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
I would like to be able to reference environment variables in container labels for container deploys (type 1)
Describe the solution you'd like
Execute variable substitution in container labels.
Describe alternatives you've considered
Use docker-compose (type 3) with variables in the labels. This works and is just inconsistent with how labels are treated for type 1 deploys.
Additional context
Add any other context or screenshots about the feature request here.
Beta Was this translation helpful? Give feedback.
All reactions