What is Dockerfile | Understanding Dockerfile Directives | How to Build an Image using Dockerfile

Published: 01 January 1970
on channel: Akash Kumar
706
22

Agenda:

What is a Dockerfile?

Dockerfile Directives

How to write a Dockerfile?

How to build and run a Docker image?


*********************************************************************

What is a Dockerfile?

Docker can build images automatically by reading the instructions from a Dockerfile.

A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image.


*********************************************************************

Dockerfile Directives

FROM Starts a new build stage and sets the base image.

ENV: Set environments variables. These can be referenced in the Dockerfile itself and are visible to the container at runtime.

COPY adds files from your Docker client’s current directory.

RUN Creates a new layer on top of the previous layer by running a command inside that new layer.

CMD specifies what command to run within the container.

WORKDIR Sets the current working directory inside the container.

ADD Similar to COPY, but can also pull files using a URL and extract an achieve into loose files in the image.

*********************************************************************

As a prerequisite, you need to have docker installed.

Docker Introduction:
   • Docker Simplified Introduction | What...  

Docker installation from Scratch:
   • How to Install and Use Docker | Docke...  


Watch video What is Dockerfile | Understanding Dockerfile Directives | How to Build an Image using Dockerfile online without registration, duration hours minute second in high quality. This video was added by user Akash Kumar 01 January 1970, don't forget to share it with your friends and acquaintances, it has been viewed on our site 706 once and liked it 22 people.