8: Containerizing an app
Docker is all about making it easy to take application source code and get it running in a container. This process is called containerization.
In this chapter, we’ll walk through the process of containerizing some simple Linux apps. You’ll need a Docker environment if you want to follow along. Any of the environments form the Getting Docker chapter will work.
We’ll split this chapter into the usual three parts:
- The TLDR
- The deep dive
- The commands
Let’s containerize an app!
Containerizing an app - The TLDR
Containers are all about making apps simple to build, ship, and run. The end-to-end process looks like this:
- Start with your application code and dependencies
- Create a Dockerfile that describes your app, dependencies, and how to run it
- Build it into an image by passing the Dockerfile to the
docker build
command - Push the new image to a registry (optional)
- Run a container from the image
Figure 8.1 shows the...