Docker

Tips #

Common commands #

  1. List all containers :

    docker container ls -a
    
  2. List all volumes:

    docker volume ls
    
  3. Clear all unused images, containers, etc

    docker system prune
    
  4. Delete all volumes using:

    docker volume rm $(docker volume ls -q)
    

similar for containers

Dockerfile and docker-compose #

Dockerfile specifies the actual image whereas docker-compose will help run multiple docker images using docker-compose up

Alternatively, you can run the docker image directly by using something like docker run --publish 8080:8080 <container-id>