Docker Cheat Sheet - SM
More complete Docker cheat sheet with explainations:
docker run -it ubuntu bash | docker start smelly-hippo | docker stats |
docker run -it ubuntu | docker stop smelly-hippo | docker stats smelly-hippo |
docker run -tid ubuntu | restart, pause, unpause, wait (block) | docker top smelly-hippo |
docker create -ti ubuntu | docker kill smelly-hippo | docker logs web |
docker run -tid --name smelly-hippo ubuntu | docker events | |
docker ps | docker rm smelly-hippo | docker port nostalgic_colden |
docker ps -a | docker rm -f smelly-hippo | |
docker inspect smelly-hippo | docker container rm -f $(docker ps -aq) |
|
|
|
docker info | grep -i storage | docker run -tid -p 1234:80 nginx # host:container |
docker inspect web # look for "Mounts" | docker run -tid -p 127.0.0.1:1234:80 ubuntu |
docker volume ls | |
docker volume create testvol1 | |
docker volume inspect testvol1 | Bridge is used by default, IPs are optional |
docker volume ls -f dangling=true | docker network ls |
docker volume rm volume1 | docker network inspect bridge |
docker run -d --name test1 -v /data ubuntu | docker network rm my-network |
docker run -d --name test2 -v vol1:/data ubuntu | docker run -tid --net=my-network --ip=192.168.25.5 --name=test1 ubuntu |
docker run -d --name test3 -v /src/data:/data ubuntu | docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container1 |
docker rm -v test1 | |
–publish 8080:80