To do a docker build, we need to have a docker file created. The docker file contents is as below -
The docker file is actually performing the below items -
FROM nginx:alpine RUN rm /etc/nginx/conf.d/* RUN echo "files are deleted" COPY ./public/helloworld.conf /etc/nginx/conf.d/ COPY ./public/index.html /usr/share/nginx/html/ COPY ./public/arti-error.txt /usr/share/nginx/html/
The docker file is actually performing the below items -
- Pull an Nginx image
- Removing all the contents of the folder “/etc/nginx/conf.d/”
- Putting a message that all the files are deleted
- Copying all the files that we have uploaded to the GitLab repository, copy it to a specific file location.