Docker Commands Cheat Sheet



This is a list of commands I find myself writing all the time to managed containers and docker swarm services on my Windows 10 dev machine.These scripts are compatible with Docker 1.12 and Docker for Windows.

  1. Docker Compose Commands Cheat Sheet
  2. Docker Run Commands Cheat Sheet
  3. Dockerfile Commands Cheat Sheet
  4. Docker-compose Commands Cheat Sheet

Docker Command Essentials. The idea of docker essentials is to summarize all the most use full docker commands. Docker status related command. To check that the docker is working correctly. You need at least to have server detected. $ docker info Container. Container related command. To create and run a container. Apr 10, 2021 - Docker command cheat sheet in Image format, Docker compose command cheat sheet and Docker commands cheat sheet pdf.

Swarm Mode

Enable swarm mode:

Create a custom overlay network:

Docker Compose Commands Cheat Sheet

These Cheat Sheet Docker Commands use multiple docker files a developer must change the application with its environments, staging and production. The Docker Compose command helps in taking this forward as it already reads two files by default. The command can be: $ docker-compose up -f my-override-1.yml my-override-2.yml. The Ultimate Docker Cheat Sheet Docker - Beginners Intermediate Advanced View on GitHub Join Slack The Ultimate Docker Cheat Sheet. Complete Docker CLI. Container Management CLIs. Inspecting The Container. Interacting with Container. Image Management Commands. Image Transfer Comnands. Builder Main Commands.

Docker is an open-source platform that can be used to build, ship, and run applications by packaging software in containers. Docker has a lot of commands and options, and it is very difficult to remember every command. This article provides a cheat sheet of the most commonly used Docker commands.

Create and start a service using a custom overlay network:

Docker Run Commands Cheat Sheet

Start a service and expose a port on the host system:

Start a service and mount a local system directory:

Start a service and mount a local volume:

List all matching services:

Get CPU, memory, network and IO statistics for all running instances of a swarm service:

Get the virtual IP list of all running instances of a swarm service:

Get the virtual IP of all running instances of a swarm service for a specific overlay network:

Get the volume list of all running instances of a swarm service:

Remove all instances of a swarm service that aren’t currently running:

Update a service:

Docker Commands Cheat Sheet

Stop a service:

Remove a service:

Docker host cleanup

Remove all stopped containers:

Remove untagged images:

Remove orphaned volumes:

Dockerfile Commands Cheat Sheet

Cheat

Containers

Start a Bash session in a running container:

Docker-compose Commands Cheat Sheet

Stop and remove all containers by image name or image ID:

Connect to a docker server over TCP:

Monitoring

Monitor MobyLinuxVM with cAdvisor container:

Note that --volume=/:/rootfs:ro mount is not available in Docker for Windows VM, that’s why I removed it from the run command.Access cAdvisor interface on your Windows machine at http://localhost:8090/.

Aggregate all containers logs with logspout:

Connect with PowerShell to see your local aggregated logs in realtime: