Writing your first Dockerfile

The conventional approach to generating a Docker image of your application is to create a Dockerfile in the root of your project. But what does the Dockerfile stand for?

A Dockerfile is a series of commands that are run through the Docker CLI. The typical workflow in such a file looks as follows:

  1. A Dockerfile starts from a base image, which is imported using the FROM command. This base image may include a runtime environment, like Node.js, or other things that your project can make use of. The container images are downloaded from the Docker Hub, which is a central container registry that you can find at https://hub.docker.com/. There is the option to download the images from custom registries, too.
  2. Then, Docker ...

Get Hands-On Full-Stack Web Development with GraphQL and React now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.