1

Docker's docker inspect gives me some metadata about a container, like:

    "Mounts": [
        {
            "Type": "bind",
            "Source": "/home/ondra/work/CI-CD/volumes/jenkins_home",
            "Destination": "/var/jenkins_home",
            "Mode": "",
            "RW": true,
            "Propagation": "rprivate"
        },

It's quite tempting for me to manipulate these values but I haven't found a way to.

Are these metadata generated on the fly? Or is there a way (an API perhaps?) to change those?

Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277

1 Answers1

2

Containers keep most of this information at json files located at:

  • /var/lib/docker/containers/2acf6...[your container id]

I've read about people stopping the docker daemon, doing changes to these files and restarting the daemon (for example here and here) but I think this is hackish.

Containers are considered to be ephemeral. So, stop / remove your container and run a new one with the new configuration.


Update: I've just found docker update and docker container update which gives access to some configuration options. (They are not supported for Windows containers).

docker update

Update configuration of one or more containers

Usage: docker update [OPTIONS] CONTAINER [CONTAINER...]

Community
  • 1
  • 1
tgogos
  • 23,218
  • 20
  • 96
  • 128