Would be nice if SingularityDeploy env vars in could be interpolated
We're running docker containers with Singularity and we're using registrator to register these container services in consul.
I would like to deploy some of these containers with docker network=HOST mode. In addition I would like to dynamically allocate ports so that the apps running in these container can use $PORT0, $PORT1, etc. to configure what port they should listen on. Registrator listens on the docker socket for containers starting/stopping and looks at the env vars of a container to control how services in that container should be registered. So it would be nice if Singularity had the ability to interpolate the keys that are passed in SingularityDeploy.env with values that it has in its context. So for example, if I specify this in SingularityDeploy.env:
"SERVICE_${PORT0}_NAME": "myservice"
Then what I'd like is for this to be passed to the docker run command:
docker run -e SERVICE_31002_NAME=myservice
where 31002 is the dynamic port allocated and assigned to $PORT0
note: see these docs for container overrides via env vars in Registrator
Another use for this is to be able to pass a listening port in the arguments parameter of the deploy section of a container running an app you don't have to code for. (Or don't want to fork/maintain/etc.)