Docker
  • Introduction
    • What is Virtualization?
      • What is a Hypervisor?
      • Microsoft Hyper-V
    • What is Containerization?
      • What is docker?
      • What is a container image?
      • When to use containers?
      • When not to use Docker containers
  • Basics
    • ▶️Pull and run an image
      • Trivia
    • Basic docker commands
    • Container life cycle
  • Build an Image
    • ▶️Console app experiment
      • Hello-world image
    • What is a docker file?
      • Our docker file explained
    • ▶️Web app experiment
      • Create application
      • Create a docker file
      • Build an image
      • Run your image
      • Manipulating containers
  • Layers & Stages
    • Introduction
    • Image layers
    • Multistage images
Powered by GitBook
On this page
  1. Build an Image

What is a docker file?

PreviousHello-world imageNextOur docker file explained

Last updated 2 years ago

What is a docker file?

It is a straightforward text file containing a collection of commands or procedures. These commands and guidelines we run act on the base image configured to create a new Docker image. A Dockerfile is the Docker image’s source code. A Dockerfile is a text file containing various instructions and configurations. The FROM command in a Dockerfile identifies the base image from which you are constructing.

When you run the Docker run command, Docker uses this file to build the image itself. The Dockerfile includes the image’s creation instructions. The benefit of utilizing a Dockerfile over merely keeping the binary image is that automated builds guarantee you always have the most up-to-date version. This is advantageous in terms of security, as you do not want to install any insecure applications.