Dockerfile is the file where are written the configurations of a Docker image.
When creating a new image you can start from an existing one.
"nginx" is the name of the existing image in this case and "alpine" is the version.
The second command means copying the local file index.html to a location on the container (/usr/share/nginx/html).
From that location nginx service gets the static html file.
Docker containers are built from images. For that you can use the command:
docker build {location_of_Dockerfile} -t {image_tag_name}
Now to run the container there is the second command:
docker run -d -p {external_port}:{internal_port} {image_tag_name}
-d parameter tells docker to run the container
-p parameter is used for port-forwarding
Test server using wget, which makes http get request.