All Docker fundamental cheatsheet from Cliff Kwok
docker
docker --version
docker pull <> # download images docker images # check existing images in docker
docker run <<image name + tag>> docker run -d <<image name + tag>> # means that a Docker container runs in the background of your terminal docker run -d -p 8080:80 <<image name + tag>> # My computer (host port) is 8080 which can access container 80 docker run -d -p 8080:80 -p 3000:80 <<image name + tag>> # 2 local port to same container port docker run --name <> -d -p 8080:80 -p 3000:80 <<image name + tag>> docker run --name <> -v $(pwd):/root/docker -d -p 8080:80 -p 3000:80 <<image name + tag>>
docker container ls # check running container
docker ps # check running container (quick way)
docker ps -a # check all contianer (show all)
docker stop <>
docker stop <>
docker start <>
docker rm <> # remove individual container
docker ps -aq # show all container id
docker rm
! # every time start a container, it create new container id
Control + C # quit when in status of running container Control pq
docker exec -it <> bash
touch about.html