Hello, it is not recommended to change the configuration of a running container. The container itself is stateless. Of course, it can also be changed by entering the inside of the container:
docker exec -it <容器id> </bin/bash|/bin/sh>
Such changes cannot be saved persistently. When the container is restarted, the changes will be lost. The correct approach is to put the data that needs to be persisted in the mounted storage volume, and directly delete and rebuild when the configuration needs to be changed. PS: Portal /q/10...
Enter the container
docker exec -it containerId/Names /bin/bash
,再使用export
修改就可以了吧export ENV='value'
Hello, it is not recommended to change the configuration of a running container. The container itself is stateless. Of course, it can also be changed by entering the inside of the container:
Such changes cannot be saved persistently. When the container is restarted, the changes will be lost. The correct approach is to put the data that needs to be persisted in the mounted storage volume, and directly delete and rebuild when the configuration needs to be changed.
PS: Portal /q/10...
Thanks for the invitation, there is a very cool thing called docker-gen. You can try to see if it can solve your problem!