This is a file specification with instructions for Docker to create an image. The instructions are clear and allow you to share that file on several servers so that Docker builds the image.
Our Dockerfile will have three parts:
- The header, which indicates the base image and author
- The instructions to build the image
- The instructions to run the image
There are many more instructions that we'll probably not cover. To get to know Dockerfile better, head over and read the documentation. This is an introduction that will actually help you go a long way. Here's our first Dockerfile:
FROM node:alpineMAINTAINER Diogo ResendeADD imagini /opt/appWORKDIR /opt/appRUN npm iCMD [ "node", "/opt/app/imagini" ]
The empty lines were ...