There are two types of Docker commands that have become established.
On the one hand, there are standalone commands. Usually, these take the form of verbs that perform a specific action. Well-known examples are “docker pull” and “docker build”. As the platform expanded and new functionalities were added, it became increasingly difficult to find suitable verbs.
So-called “Docker management commands” were introduced to group commands and restore order to the diversity of commands. Docker management commands are usually nouns. Well-known examples are “docker image” and “docker container”. The Docker management commands group verbs as subcommands.
In this way, the same verbs can be used in different contexts. For example, the command “docker image rm” is used to remove an image while “docker container rm” is used to remove a container.
Regardless of whether Docker standalone commands or Docker management commands are being used, the Docker commands are invoked on the command line. The name of the command is entered followed by optional parameters. If necessary, this is followed by the name of one or more objects. This can be a container, an image, a volume, or similar.
Let’s look at the general structure of a Docker command on the command line. In the simplest case, only the Docker CLI is called with an option appended: