I have a docker container with a environment variable that I want to change on restart time. I have read about the -e
option that can be used for that in docker run
command (described for instance here).
I have tried to use it with restart:
sudo docker restart 1db2df40d98c -e FOOBAR_VERSION='v1'
However, I get this error:
unknown shorthand flag: 'e' in -e
See 'docker restart --help'.
I have also read about re-building the container with the new environment variable value. However, I'd like to avoid so overhelming alterantive. I just want to restart the container, but with a different environment variable value at starting time.
Any hint/reference/help regarding this problem is really welcome, please.
EDIT: I have also tried doing the restart in two steps, I mean:
sudo docker stop 1db2df40d98c
sudo docker start 1db2df40d98c -e FOOBAR_VERSION='v1'
But the result is the same.