When docker run alpine ls is executed, Docker carries out the following steps behind the scenes:
- It finds the alpine image locally. If this is not found, Docker will try to locate and pull it from the public Docker registry to the local image storage.
- It extracts the image and creates a container accordingly.
- It executes the entry point defined in the image with commands, which are the arguments after the image name. In this example, the argument is ls. By default, the entry point is /bin/sh -c on Linux-based Docker.
- When the entry point process is finished, the container then exits.
An image is an immutable bundle of code, libraries, configurations, and everything else we want to put in it. A container is an instance ...