-1

I checked the closed issue reported on github: https://github.com/moby/moby/issues/3285

But the solution doesn't works.

Jaswinder
  • 1,455
  • 14
  • 27

1 Answers1

0

I guess you want to add environment variables to an already running container.

From an environment-file, there's no way to do it currently, except removing the container and starting it again with the new env-file.

For single variables you can use docker exec CONTAINER_NAME export VARIABLE=VALUE.

The issue you linked to is about container configurations like cpu-limits and memory limits. Also you can change the restart policy with docker update.

samprog
  • 2,454
  • 1
  • 13
  • 18
  • Not able to override existing environment variable using export method – Jaswinder Nov 11 '17 at 13:16
  • How are you checking if they got overrode? If you try to get the changed variables with `docker exec -ti CONTAINER_NAME bash`, you won't get them, as it acts similiar to an ssh session inside the container (new environment, old variables). Try checking with `docker exec -ti CONTAINER_NAME env` – samprog Nov 11 '17 at 13:56