标签:repo firewalld 端口 cat Opens centos 等等 技术 tar
docker pull centos:6
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos 6 70b5d81549ec 2 months ago 195MB
mkdir -p /data/docker/lnmp-test/dockerfile/nginx
vim /data/docker/lnmp-test/dockerfile/nginx/Dockerfile
FROM centos:6
LABEL maintainer="1012405802@qq.com" description="Nginx image"
ENV NGINX_VERSION 1.8.1
COPY 3rdPartyModules /root/3rdPartyModules
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 && CONFIG=" --prefix=/usr/local/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --with-http_ssl_module --user=nginx --group=nginx --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/usr/local/nginx/client_temp --http-proxy-temp-path=/usr/local/nginx/proxy_temp --http-fastcgi-temp-path=/usr/local/nginx/fastcgi_temp --http-uwsgi-temp-path=/usr/local/nginx/uwsgi_temp --http-scgi-temp-path=/usr/local/nginx/scgi_temp --with-threads --with-file-aio --with-http_realip_module --with-http_addition_module --with-http_gunzip_module --with-http_gzip_static_module --add-module=/root/3rdPartyModules/echo-nginx-module-0.58/ --add-module=/root/3rdPartyModules/nginx-http-concat-1.2.2" && yum install -y gcc pcre-devel openssl-devel && groupadd nginx && useradd -s /sbin/nologin -M -g nginx nginx && tar -zxvf /root/3rdPartyModules/nginx-$NGINX_VERSION.tar.gz -C /root/3rdPartyModules/ && cd /root/3rdPartyModules/nginx-$NGINX_VERSION && ./configure $CONFIG && make -j $(getconf _NPROCESSORS_ONLN) && make install && mkdir -p /etc/nginx/conf.d && ln -s /usr/local/nginx/sbin/* /usr/local/sbin/ && chown -R nginx:nginx /usr/local/nginx/ && rm -rf /root/3rdPartyModules/ && yum clean all
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
cd /data/docker/lnmp-test/dockerfile/nginx/
docker build -t centos6:nginx .
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos6 nginx 4a86f591315d 28 minutes ago 388MB
centos 6 70b5d81549ec 2 months ago 195MB
docker run -d -p 80:80 --name nginx centos6:nginx
firewall-cmd --add-port=80/tcp --permanent
systemctl restart firewalld
DockerFile部署lnmp+memcached+redis+mongodb开发环境for Nginx(一)
标签:repo firewalld 端口 cat Opens centos 等等 技术 tar
原文地址:https://www.cnblogs.com/93bok/p/9684819.html