Docker

  • 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

  • set variables: ARG variable=value

  • use variables example: WORKDIR /home/$variable

docker-compose