In Chapter 2, Working with Docker Containers, recipe Starting a container, we methodically and meticulously explored different ways of running containers. In all those scenarios, we used the docker container run command with a few options, and all our containers were up and running. However, behind the scenes, the Docker CLI makes it possible by first creating the container layer through the /create API and then launches the application (cmd) through the /start API, as visualized here:
In addition to the /create and /start API, the Docker CLI uses APIs such as /attach and /wait to fulfill our request. In this recipe, we will create an alpine container and run a simple ls command to demonstrate the steps involved in launching a container through the Docker engine APIs.