Dockerfile - Build your own Docker Image

What is Dockerfile?

A Dockerfile is a script that automatically creates containers on the Docker platform. A Dockerfile is basically a text document that contains all the commands a user could call on the command line to assemble an image.

Dockerfile commands

Each instruction in a Dockerfile results in an Image Layer:

It's common to start with an existing base image in your application's Dockerfile:

Command to build an image from a Dockerfile and a context

Uses the current directory ( . ) as build context

The build's context is the set of files at a specified location

i

Last updated