Dev m6 Demodoc1 v1 Cuc Zup4fw8
Dev m6 Demodoc1 v1 Cuc Zup4fw8
Docker Containers
docker search # search the images in docker hub
docker pull # pull image from docker hub
docker images # list the images in local
docker run (interactive / detached ) # run a container from an image
docker ps # list the running containers
docker ps -a # list running + exited containers
docker inspect # inspect a container
docker stop|start|restart # stop/start/restart a container
docker rm / docker rm -f # remove the containers from the server
docker exec # get inside a running container
Docker Images
docker images # list images in local
docker commit ( manual ) # create image from container changes
docker build ( automated ) # create image using a dockerfile
docker history # view the layers of an image
docker inspect # inspect an image
docker rmi # remove image from local
image repository
docker hub (public) # docker image repository
docker registry container (private) # docker image repository open source
DTR (private) # docker image repository licensed tool from docker org
docker login # login to image repo from command line
docker tag # create alias name for an image in local
docker push # push images to docker image repository
Docker Volumes
docker volume ls # list volumes in local
docker volume create # create a volume
docker inspect volume # inspect the volume
Docker COMPOSE:
Docker Networking:
docker network ls # list the default & custom networks on a docker host
none|host|bridge|overlay|docker_gwbridge
docker network create -d <driver> <network name> # create a custom network of
bridge/overlay
docker run -d --net host --name cont1 alpine # attach a container to host network
docker run -d --net none --name cont2 alpine # attach a container to none network
docker run -d --net ravinet --name cont3 alpine # attach a container to custom
bridge/overlay network
Docker Swarm
Page 1
Module 6: Containerization using Docker Part - I
docker node ps ## List tasks running on one or more nodes, defaults to current
node
Page 2