The build-share-run workflow packages an application into a Docker image, publishes that image for reuse, and lets other users run it in containers. The same process works for a small script or a multi-component application with configuration files and libraries, while Docker provides portability across supported computers. section 2.1
The workflow has three practical stages:
- Build: package the application so it can run in a container. section 2.1
- Share: publish the resulting image so other users can obtain it. section 2.1
- Run: start a container from the image; Docker downloads it when necessary and reuses a local copy afterward. section 2.1 section 2.5
The Docker CLI sends commands through the Docker API to the Docker Engine. The Engine manages images, containers, networks, and other resources, so the same run workflow can release software such as Elasticsearch, SQL Server, or Ghost. section 2.5
Run a shared image
Running docker run diamol/ch02-hello-diamol:2e downloads the image if needed, starts the application in a container, and displays its output. Repeating the command runs another container from the cached image; its generated name and possibly its IP address differ. section 2.1
