I have an image of a docker that is partially ready for work. For it to work fully, I need to run
sudo docker run -d -p 80 --name myimage -e ADMIN_USER="user1" -e ADMIN_PASSWORD='password1' leonixyz/myimage:1.0
When I first run the image, my code sets up the application inside.
This is convenient, because every time I need a new instance of the application that needs to be configured for a different user each time, I can pass different environment variables to docker runand my code will configure the container specifically for the new user.
Unfortunately, I see that these variables cannot be removed from the container.
If I do:
sudo docker exec -it <container_id> bash
then I see the variables ADMIN_USERand ADMIN_PASSWORD(obviously) is still there.
I tried unset ADMIN_PASSWORDat the end of my one-time configuration code, but it does not work.
unset ADMIN_PASSWORD bash .
, ?
, , , https://github.com/docker/docker/issues/13490#issuecomment-162125128.