Creating a Dockerfile is remarkably easy. A Dockerfile is basically a text file, that is used with Docker to build a container from a Docker image. You usually start by creating a text file named Dockerfile in a new directory. You don’t want to put a Dockerfile in the root of the C drive for example, because every file and folder below the Dockerfile will get packaged into the built container.
First line of a Dockerfile usually is just a comment starting with a pound # sign.
Then you tell Docker what image to use when creating the container like this:
Next you add a MAINTAINER which is your name and/or email address
MAINTAINER Name firstname.lastname@example.org
Now we start the next line with a RUN command, that tells the container the first command to run. For example,
RUN apt-get update && /bin/bash
After the RUN command, you can then use EXPOSE 80,443 to open firewall ports 80 and 443,
there are a few different commands we can use here, but the last command will be CMD
This CMD line tells the container what process to run as its main process, and since most containers are supposed to run only one process, (although they can run more than one, best-practice is to only run one process in each container)
CMD commands should be written inside of  brackets…