Using Docker (Part Two): Building Images
Today, I want to talk a bit more about Docker. My previous post focused on the basics of Docker (what it is, what problem it solves) and how to run an image that already exists. This time, I’ll run through building your own image from scratch so you can containerize your own application. This is part 2 in a series on Docker and containers. The Dockerfile Since we’ve already covered how containers work, let’s jump right into building an image. Drawing from the previous post, a Docker image is a specification for how a Docker container should run. The image is defined in a Dockerfile, which is a series of special commands that the Docker runtime executes to build the image. Each command represents a new “layer” of the image. Images always start with a FROM command indicating which image should be used as a source, and make modifications to that image which are stored as “layers” on top of the original specification. ...