Created at:

Modified at:

docker notes

Generic notes

Running a command inside a running container

# docker exec -u root -it <container_name> bash

Checking a docker image content

(2023-06-26)

The easiest approach is to just start a shell container:

# docker run -it imagename bash

How to see docker image contents

Changing docker IP prefix

By default docker uses 172.17.0.0/16 subnet. To change it to somewhere else, create the file /etc/docker/daemon.json with a content similar to the following one:

{
    "bip": "192.168.0.1/24"
}

How to Get a Docker Container IP Address

Deleting a named docker volume

(2022-11-16)

1. Stop containers with docker stop or docker-container stop or other command.

2. Remove containers that use the volume with docker rm.

3. List volumes with docker volume ls.

4. Remove volumes with docker volume rm.

5. Recreate and start containers with docker-container up -d or other command.