Docker
Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications, whether on laptops, data center VMs, or the cloud.
Installation
First, you need to set up the Docker repository.
Then, to install the latest version, run:
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Configuration
If you would like to use Docker as a non-root user, you should now consider adding your user to the "docker" group with something like:
sudo usermod -aG docker your-user
Remember to log out and back in for this to take effect!
Usage
To test Docker installation:
docker run hello-world
To list Docker images:
docker image ls
To list all Docker containers:
docker container ls --all
To list running containers:
docker ps
To kill all running containers:
docker kill $(docker ps -q)
To delete all stopped containers:
docker rm $(docker ps -a -q)
To delete all images:
docker rmi $(docker images -q)