How to set an environment variable in a running docker container

前端 未结 11 1178
难免孤独
难免孤独 2020-11-29 23:28

If I have a docker container that I started a while back, what is the best way to set an environment variable in that running container? I set an environment variable initia

11条回答
  •  时光说笑
    2020-11-30 00:25

    Docker doesn't offer this feature.

    There is an issue: "How to set an enviroment variable on an existing container? #8838"

    Also from "Allow docker start to take environment variables #7561":

    Right now Docker can't change the configuration of the container once it's created, and generally this is OK because it's trivial to create a new container.

提交回复
热议问题