[Docker Redis] Docker Frequently Asked Questions (FAQs)

Docker FAQs

Modify container by config file

Each Docker container has a set of config files associated with it. The parameters of that container, such as Image, Port mapping, would be specified in that file.

The config file is a json file at the location /var/lib/docker/containers/<Container ID>/config.v2.json.

1
2
3
4
5
6
7
8
9
10
11
12
13
# Get container id.
$ docker ps

# Or get container id.
$ docker inspect <Container Short ID>

# Stop container
$ docker stop <Container Short ID>

$ vi /var/lib/docker/containers/<Container ID>/config.v2.json

# Start container
$ docker start <Container Short ID>

After stopping the container, the config.v2.json file can be edited to update the corresponding entry for Ports and NetworkSettings. The PortBindings entry in hostconfig.json file is also updated.

After making the changes in config files, Docker service is restarted and container is started.

See Docker - change container configuration in 4 ways - https://bobcares.com/blog/docker-change-container-configuration/ to learn more.

References

[1] Empowering App Development for Developers | Docker - https://www.docker.com/