Here is the list of commonly used Docker commands:
Purpose | Command |
---|---|
Image |
|
Build an image |
|
Install an image |
|
List of installed images |
|
List of installed images (detailed listing) |
|
Remove an image |
|
Remove unused images |
|
Remove all images |
|
Containers |
|
Run a container |
|
List of running containers |
|
List of all containers |
|
Stop a container |
|
Stop all running containers |
|
List all exited containers with status 1 |
|
Remove a container |
|
Remove container by a regular expression |
|
Remove all exited containers |
|
Remove all containers |
|
Find IP address of the container |
|
Attach to a container |
|
Open a shell in to a container |
|
Get container id for an image by a regular expression |
|
The exit code from docker run
gives information about why the container failed to run or why it exited. The complete list of code is listed:
All other codes are the exit code of the command running in the container.