![]() Add the following to the beginning of your Dockerfile to use the official CentOS 7 image from the Docker Hub.The FROM instruction needs to be the first instruction in your Dockerfile, as it is the environment all subsequent instructions will be ran in. In our example, we will be using the official CentOS image from our previous tutorials. The FROM instruction specifies the base image to use as a foundation to our new image. In this tutorial we will be using the following instructions: FROM You can read more about instructions and arguments in the dockerfile reference documentation Each line has an instruction and argument. The dockerfile format is fairly straightforward. Create a new directory for your docker build file.This will help keep everything organized and give you a place to store any extra files if needed. It is recommended that each docker file is contained in a separate directory. We will go over how to create one for nginx on CentOS in this tutorial. ![]() A docker file is essentially a script which can recreate the building of your image. The recommended way to create images for sharing is from a docker file.
0 Comments
Leave a Reply. |