Search⌘ K
AI Features

Defining Our First Custom Image

Explore the process of building custom Docker images for Rails apps using Dockerfiles and the docker build command. Understand image creation, intermediate images, and how to tag and list your Docker images to effectively manage your containerized Rails environment.

Build image

The process of generating an image from a Dockerfile is called building an image. We do that with the docker build command, which has the following format:

$ docker build [options] path/to/build/directory 

If we are in the directory containing our Dockerfile and project file, we can use the following command:

$ docker build . 

To name the image, we use -t option:

 ...