Build image from dockerfile
docker build PATH
docker images
docker ps
docker ps -a
docker rmi IMAGE
docker rm CONTAINER
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
Attach to a container, sig-proxy to avoid wrong CTRL+C behavior
docker attach --sig-proxy=false CONTAINER
Detach from a container (leaving it running)
CTRL+C
Detach from a container getting a stacktrace
CTRL+\
docker stop
docker kill
Commit an image from a container
docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
Copy files/folders from a container's filesystem to the host path
docker cp CONTAINER:PATH HOSTPATH
docker diff CONTAINER
Get realtime events from the docker server
sudo docker events
Show the history of an image
docker history IMAGE
Inspect an image or container
docker inspect CONTAINER | IMAGE
Fetch the logs of a container
docker logs CONTAINER
Restart a running container
docker restart CONTAINER
Search docker hub for images
docker search TERM
Display running processes of a container
docker top CONTAINER
Add tag to an existing image
docker tag IMAGE USER/REPO:TAG
Show corresponding public-facing port of a private port
docker port CONTAINER PRIVATE_PORT