I have a container running with env variable X=value. This was set when container was built from .env file. Is it possible to update this variable in the container itself?
I execd into container using docker exec -it <containerid> sh
, then tried running env X=newValue
. After this all env variables print out and the X value is shown as 'newValue', but when I run env
again, it still shows X as 'value', seems as it rolls back to it. Is there a way to update this without the need to stop current container and rebuilding it from scrach?
Thanks