Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How to set an enviroment variable on an existing container? #8838

@Boran

Description

@Boran

One can pass environment vars into new containers when building them with "docker run":
docker run -e "FOO=bar" ...

But how can one do that for an existing container, there is no -e option for docker run.
I wish to be able to restart a container with a new environment setting, but do not wish to actually recreate the container (as it has lots of manual changes in there).

One option might be to commit the container to an image and create a new container based on that image. Seems a very roundabout way though.

have I missed something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions