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