Written by
Imran
on
Docker Commands in Practice
2
min read
General Usage
Start a container in background
Start an interactive container
View the contents of an image/container
Export port from a container
Start a named container
Restart a stopped container
Stop a container
Build Images
Build an image from Dockerfile in current directory
Force rebuild of Docker image
Convert a container to image
Chnage image name
Remove all unused images
Manage Containers
List running containers
List all containers (running & stopped)
List local available images
Delete all stopped containers
List all containers with a specific label
Copy files of a container to local directory
Debug
Run another process in running container
Show live logs of running daemon container
Show exposed ports of a container
Volumes
Create a local volume
Mounting a volume on container start
Destroy a volume
List volumes
Networking
Create a local network
Attach a container to a network on start
Connect a running container from a network
Disconnect container to a network