Manually build a docker nginx Image

Source: Internet
Author: User
Tags docker run

Docker run -- name nginx-man-It centos to create a centos
Yum install-y wget GCC gcc-C ++ make OpenSSL-devel Build Environment
Wget http://nginx.org/download/nginx-1.14.0.tar.gz get nginx installation package
Wget https://ftp.pcre.org/pub/pcre/pcre2-10.23.tar.gz -- no-check-Certificate
Obtain PCRE
Tar zxf nginx-1.14.0.tar.gz
Tar zxf pcre2-10.23.tar.gz unzip two packages
CD nginx-1.14.0
Useradd-S/sbin/nologin-M WWW
./Configure -- prefix =/usr/local/nginx -- user = WWW -- group = WWW -- with-http_ssl_module -- with-http_stub_status_module -- With-PCRE =/usr/local/src/pcre2-10.23
Make
Make install

VI/usr/local/src/nginx-1.14.0/CONF/nginx. conf write daemon off;
Exit
Docker commit-M "My nginx" 335573f4503c sjw/My-nginx: V1 creates an nginx image of its own. nginx is automatically started when it is started.
Docker run-D-P 92: 80 sjw/My-nginx: V1/usr/local/nginx/sbin/nginx start docker

 

Manually build a docker nginx Image

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.