I'm trying to run a docker container and when I do docker run
I need to pass it an environment variable that is defined inside the container.
The docker container in question is consul (https://github.com/hashicorp/docker-consul/blob/9fb940c32b6f46b0a77a640d7161054e00e97bbb/0.X/Dockerfile) and it has a custom script as entrypoint. Therefore the classic sh -c '...$VARIABLE'
won't work because all this goes as arguments to the entrypoint and it obviously fails.
Directly writing something like:
docker run consul [...] $VARIABLE
also doesn't work because $VARIABLE gets evaluated in the host and not in the container.