Saltar a contenido

Docker cheatsheet

Overview

Docker allows for creating virtual environments in an isolated manner in support of virtualization of computing resources. The basic concept behind Docker is containerization, where software can run as services, interacting with other software containers, for example.

The typical Docker workflow involves creating and building images, which are then run as live containers.

Docker is used to run the suite of services that make up wis2box using pre-built images.

Image management

  • List available images
docker image ls
  • Update an image:
docker pull my-image:latest
  • Removing an image:
docker rmi my-image:local

Volume Management

  • List all created volumes:
docker volume ls
  • Display detailed information on a volume:
docker volume inspect my-volume
  • Remove a volume:
docker volume rm my-volume
  • Remove all unused volumes:
docker volume prune

Container Management

  • Display a list of currently running containers:
docker ps
  • List of all containers:
docker ps -a
  • Enter the interactive terminal of a running container:

Tip

use docker ps to use the container id in the command below

docker exec -it my-container /bin/bash
  • Remove a container
docker rm my-container
  • Remove a running container:
docker rm -f my-container