12.05.15



Dockerfile Parameters







The Dockerfile uses parameters inside of it to define what will be done.


Commonly used parameters are:


FROM - by default gets images from dockerhub


RUN - to run the command on the base image


EXPOSE - to open the ports


VOLUME - to map the volumes [from the docker host to the docker container]


COPY - similar to ADD [copy files from the docker host to the docker container]


ADD - similar to COPY - it also copies files from third parties like websites


CMD/ENTRY POINT - similar to RUN, but these command will be executed at the time of the container creation. They won’t be executed while building images. Good to run automatically


ENV - to set the environment variables


WORKDIR - changes the active directory of the container to a specified location if you need to run commands from or in a particular location