Cleanup and Docker Basics

View source on GitHub

Docker maintenance

If you are having problems with OTBR Docker, you might have multiple containers running. Before running OTBR Docker, we recommend cleaning up any extraneous Docker containers, both running and stopped.

Note that there is a difference between Docker images and containers. Images are the source, while containers are instances of the source image. You can have multiple container instances running from the same source Docker image.

To view all stopped and running Docker containers on your machine:

docker ps -a
CONTAINER ID IMAGE        COMMAND       CREATED      STATUS  PORTS   NAMES
d09847ad66bf 43e7a898e524 "/app/bord.." 26 hours ago Exited          john.smith

To stop and remove a specific Docker container, use the Container ID from the previous command:

docker stop d09847ad66bf
docker rm d09847ad66bf

To stop and remove all Docker containers at once:

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

To view all Docker images:

docker images
REPOSITORY                 TAG       IMAGE ID       CREATED       SIZE
openthread/border-router   latest    08666d77013d   2 hours ago   171MB

To remove a Docker image, use the Image ID from the previous command. Note that any stopped or running containers based on the image must be removed prior to removing the Docker image.

docker image rm 98416559dcbd