docker login
- log in to dockerhubdocker pull docker_image_name:tag_name
- pull/download image from hub
docker container --help
- list help for docker container commanddocker container ls
- list running containersdocker container logs -f container_name
- see logs of a running container
docker image --help
- list help for docker image commanddocker image ls
- list imagesdocker image build -t some_tag_name .
- build imagedocker image rm image_name
- delete imagedocker image inspect image_name
- inspect image
docker volume create volume_name
- create named volumedocker volume ls
- list volumes
docker network ls
- list network
docker system df
- print disk size info being used by docker images, containers and volumesdocker system prune
- clean up
docker volume create redis_data
- create named volume called redis_datadocker container run --rm -itd -p 5000:5000 -e FLASK_APP=app.py -e FLASK_DEBUG=1 --name flask_app_name -v $PWD:/app --net some_network flask_app
- run a flask app on some_network networkdocker container run --rm -itd -p 6379:6379 --name redis_name --net some_network -v redis_data:/data redis:3.2-alpine
- run redis on some_network networkdocker container stop redis_name
- stop redis_name containerdocker run -it ubuntu sh
- connect to a running ubuntu container and run shdocker exec redis ifconfig
- run ifconfig from a running redis containerdocker exec -it redis redis-cli
- connect to a running redis container and run redis-clidocker pull redis:3.2-alpine
- download redis:3.2-alpine image