dockerfile Example-nginx

Source: Internet
Author: User

L Download First Nginx the configuration file wget http://www.apelearn.com/study_v2/.nginx_conf

L vim Dockerfile// The contents are as follows

############################################################
# Dockerfile to build Nginx installed Containers
# Based on CentOS
############################################################
# Set The base image to CentOS
From CentOS
# File Author/maintainer
Maintainer aming [email protected]

# Install Necessary Tools
RUN Yum install-y pcre-devel wget net-tools gcc
RUN Yum install-y zlib zlib-devel make

RUN Yum install-y openssl-devel

# Install Nginx
ADD http://nginx.org/download/nginx-1.8.0.tar.gz.
Run tar zxvf nginx-1.8.0.tar.gz
Run mkdir-p/usr/local/nginx

L RUN cd nginx-1.8.0.tar.gz &&./configure--prefix=/usr/local/nginx && make && make install
RUN rm-fv/usr/local/nginx/conf/nginx.conf
COPY. nginx_conf/usr/local/nginx/conf/nginx.conf

# Expose Ports
EXPOSE 80
# Set The default command to execute
# When creating a new container
entrypoint /usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf

L To create a mirror:

L Docker build-t Centos_nginx.

L Docker Images you can see our new image.


dockerfile Example-nginx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.