Minimum about Docker

To get the basic Docker information, you can run:

docker info

Look for Docker Root Dir to get the location of your docker containers. Your containers will be saved to the containers subfolder under the root directory. On the raspberry I am using the default storage driver overlay2, which apparently means that the Docker images are stored in /var/lib/docker/overlay2.

To verify Docker’s status run the following command, and look under the Active field:

sudo systemctl status docker

To stop a running Docker container, you will need to first obtain the container ID (add -a to the command below to see all containers, including those that are not currently running):

docker ps

The container ID is shown in the first column. Use it with the following command (replace the ×××× with the ID):

docker stop ××××

After you have stopped a container, your safest approach for removing it is by pruning. Run this command to remove all stopped and unused containers:

docker system prune -a

This will remove all content in the overlay2 and containers subfolders.

Leave a comment