$ docker run -it --name container_name image_name
$ docker create --name container_name image_name
$ docker start container_name
$ docker stop container_name
$ docker restart container_name
$ docker pause container_name
$ docker unpause container_name
$ docker exec -it container_name command
$ docker ps
$ docker ps -a
$ docker inspect container_name
$ docker logs container_name
$ docker stats container_name
$ docker top container_name
$ docker images
$ docker pull image_name
$ docker rmi image_name
$ docker build -t image_name:tag .
$ docker tag image_id new_image_name:new_tag
$ docker push new_image_name:new_tag
$ docker network ls
$ docker network inspect network_name
$ docker network create network_name
$ docker network connect network_name container_name
$ docker network disconnect network_name container_name
$ docker volume ls
$ docker volume inspect volume_name
$ docker volume create volume_name
$ docker volume rm volume_name
$ docker run -v volume_name:/container/path image_name
$ docker-compose up
$ docker-compose down
$ docker-compose ps
$ docker-compose logs
$ docker attach container_name
Press Ctrl + P, Ctrl + Q
$ docker exec -it container_name /bin/bash
$ docker inspect --format='{{.NetworkSettings.IPAddress}}' container_name
$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name
$ docker run -it --cpu-shares=512 --memory=512m image_name
$ docker swarm init
$ docker swarm init --advertise-addr <node_ip>
$ docker swarm join-token worker
$ docker swarm join-token manager
$ docker service create --replicas N --name service_name image_name
$ docker service ls
$ docker service ps service_name
$ docker service update --replicas N service_name
$ docker service rm service_name
$ docker node ls
$ docker node inspect node_id
$ docker node update --label-add key=value node_id
$ docker node rm node_id
$ docker push repository_name/image_name:tag
$ docker pull repository_name/image_name:tag
$ docker login registry_url
$ docker logout registry_url
$ docker search search_term
$ docker image ls
$ docker image rm image_name
$ docker image prune
$ docker-compose up -d --scale service_name=N
$ docker-compose scale service_name=N
$ docker-compose up --build
$ docker-compose up -d --force-recreate
$ docker-compose --env-file .env up
$ docker-compose up -e KEY=VALUE
$ docker-compose -f docker-compose-network.yml up
$ docker-compose -p project_name up
$ docker-compose -f docker-compose-volumes.yml up
$ docker-compose -v volume_name:/container/path up
$ docker-compose -v ./host/path:/container/path up
$ docker-compose --health-cmd 'command' up
$ docker-compose --health-interval 5s up
$ docker-compose logs service_name
$ docker-compose exec service_name command
$ docker-compose pause service_name
$ docker-compose unpause service_name
$ docker-compose top
$ docker-compose restart service_name
$ docker-compose stop service_name
$ docker-compose start service_name
$ docker-compose down
$ docker-compose down -v
$ docker-compose down --rmi all
$ docker-compose down --remove-orphans
$ docker-compose --env-file .env.override up
$ docker-compose -f docker-compose.override.yml up