Aditya's Corner 🚀

16 Mar 2023

Intro to Dockerfile

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

In otherwords, it will have commands that you want to run to build your docker image.

Example file -

# This image is based on python:3.9 docker image
from python:3.9

# install pandas in the base image.
RUN pip install pandas

# Make the entrypoint for this image as bash.
# Same as docker run -it -entrypoint=bash python:3.9
# This will run docker image and instead of python prompt you will get bash.
ENTRYPOINT [ "bash" ]