Sysadmin job is no fun unless you can automate boring and repetitive tasks. All the commands we have learned so far could be automated by putting all the commands in a
Dockerfile and we can use
docker build command to automatically build a container.
Create a Dockerfile:123$ mkdir nginxcd nginxvim Dockerfile
- Build a container from a Dockerfile:
Every command/ directive we put in the Dockerfile adds a new layer into the container adding extra space and cruft. So, it’s important to add as much data as we can into each directive, such as