Docker

Commands

  • build: docker build . -t <tag_name>
  • connect to a container: docker exec -it <container_name> bash
  • delete
    • delete all volumes: docker volume rm $(docker volume ls -q) - docker volume rm - docker volume ls
    • delete all: docker stop $(docker ps -aq) && docker rm $(docker ps -aq) && docker rmi $(docker images -q)
  • list containers - docker ps
    • list running containers: docker ps
    • list all containers: docker ps -a

Dockerfile

docker-compose

Last modified October 20, 2022: add Dockerfile optimization (974b75a)