docker build -t <name>:<version> /path/to/directory_with_Dockerfile
docker images
docker image rm <id>
docker run -it -p 8080:80 --name <name> <imagename> /bin/bash
docker run -it -p 8080:80 --name <name> <imagename>
docker run --rm -it --name <name> <imagename> <cmd>
docker run -d --name <name> <imagename> <cmd>
echo test | docker run -i --name <name> <imagename> cat
docker run -it -v </src>:</dst> --name <name> <imagename>
docker run -it -v </src>:</dst>:ro --name <name> <imagename>
docker run -it --mount type=bind,src=</src>,dst=</dst> --name <name> <imagename>
docker run -it --mount type=bind,src=</src>,dst=</dst>,readonly --name <name> <imagename>
export VAR1=muh1 docker run -it -e VAR1 --env VAR2=muh2 --name <name> <imagename> /bin/bash
docker ps -a
docker container ls -a
docker stop <name_or_id>
docker rm <name_or_id>
docker logs <name_or_id>
Removes anything that is not in use.
docker system prune -a
docker-compose up -d
docker-compose stop
Removes containers, networks, … but NO volumes!
docker-compose down
Removes containers, networks, … AND volumes!
docker-compose down --volumes