1.Dockerfile
FROM centos:7.6.1810 MAINTAINER openresty1.15.8.2 <dingxiaowei@do1.com> RUN yum install -y yum-utils && yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo && yum clean all && yum install -y openresty RUN useradd appuser && mkdir -p /mnt/data/logs/nginx/ && mkdir -p /home/appuser/openresty/nginx/logs/ && mkdir -p /home/appuser/www-prod/ ADD ./www-prod/ /home/appuser/www-prod/ ADD ./html /usr/local/openresty/nginx/html/ ADD ./conf/ /usr/local/openresty/nginx/conf/ RUN chown -R appuser.appuser /usr/local/openresty/ && chown -R appuser.appuser /home/appuser/ #RUN yum -y install epel-release && yum install -y yum-utils && yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo && yum install -y openresty && yum clean all && chmod +x start.sh && chmod +x auto-reload.sh #ADD nginx.conf /usr/local/openresty/nginx/conf/nginx.conf EXPOSE 8004 CMD /usr/local/openresty/nginx/sbin/nginx -g 'daemon off;' -c /usr/local/openresty/nginx/conf/nginx.conf
2.构建镜像
docker build -t openresty:1.15.8.2 -f ./Dockerfile .
3.山东环境ip
[root@frontend-1 openresty]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 52:54:00:28:ee:89 brd ff:ff:ff:ff:ff:ff inet 172.17.0.17/20 brd 172.17.15.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::5054:ff:fe28:ee89/64 scope link valid_lft forever preferred_lft forever
4.https://www.cnblogs.com/xjnotxj/p/13094290.html 调试rewrite和location