The Docker CLI versus Compose commands
Most of these commands seem familiar to the ones we used through the Docker CLI. The difference between the Compose and the Docker CLI commands is that the CLI commands operate through all the Docker components in your system, whereas the Compose ones are limited in the context of the Compose application specified in the docker-compose.yaml
file.
Behind the scenes, the Compose
command will parse the Compose file and retrieve information about the application. The API calls issued to the Docker Engine will contain filters based on the information retrieved previously and will interact only with the services and resources of the application. For example, the ps
command, instead of retrieving all the running containers, which would have happened if we used the Docker CLI, will retrieve only the containers that should run on the Compose application.
Setting up the target application
In order to make the commands showcase feasible, we will...