Dockerfile is the file which helps creating an image.
Lets learn the basics from a basic docker file. You may know more : https://docs.docker.com/engine/reference/builder/
Now, lets learn line by line
- First we import from some distribution so that we can save our time.
We have imported from debian distribution. It surely can vary.Here we are using the release "buster-slim"
- Give the way to set environment variables.
- Run command which runs several shell commands of the distribution you are using.
it uses && to keep the within 1 layer
- Pointing our log files to stdout & stderr
Basically docker handles all of our logging here .
- Expose ports
By default no ports are open but we can open them by listing them here
- Final commands to run
So, these were the basics of Dockerfile.
Top comments (0)