提交dockerfile
This commit is contained in:
23
dockerfile/nginx/Dockerfile
Normal file
23
dockerfile/nginx/Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
FROM registry.openanolis.cn/openanolis/anolisos:8.6
|
||||
|
||||
ADD nginx-1.24.0.tar.gz /usr/local/
|
||||
|
||||
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
||||
source /etc/profile && \
|
||||
echo "Asia/Shanghai" > /etc/timezone && \
|
||||
yum -y install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel make && \
|
||||
yum -y update libnghttp2 && \
|
||||
useradd -M nginx && \
|
||||
cd /usr/local/nginx-1.24.0/ && \
|
||||
./configure --with-http_ssl_module --with-http_secure_link_module && make && make install && \
|
||||
yum -y remove gcc-c++ && \
|
||||
rm -rf /var/cache/yum/* && \
|
||||
mkdir -pv /usr/local/nginx/conf/conf.d && \
|
||||
mkdir -pv /storage/nginx_logs/ && chown -R nginx:nginx /storage/nginx_logs && \
|
||||
echo "ok" > /usr/local/nginx/html/index.html && \
|
||||
rm -rf /usr/local/nginx-1.24.0
|
||||
|
||||
COPY nginx.conf /usr/local/nginx/conf/
|
||||
COPY localhost.conf /usr/local/nginx/conf/conf.d/
|
||||
EXPOSE 80 443
|
||||
CMD ["/usr/local/nginx/sbin/nginx","-g","daemon off;"]
|
||||
23
dockerfile/nginx/Dockerfile-1.28.2
Normal file
23
dockerfile/nginx/Dockerfile-1.28.2
Normal file
@@ -0,0 +1,23 @@
|
||||
ARG NGINX_VERSION=1.28.2
|
||||
|
||||
#FROM registry.openanolis.cn/openanolis/anolisos:8.6
|
||||
FROM registry.openanolis.cn/openanolis/anolisos:8.10
|
||||
|
||||
ARG NGINX_VERSION
|
||||
|
||||
ADD nginx-${NGINX_VERSION}.tar.gz /usr/local/
|
||||
|
||||
RUN yum -y install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel make libnghttp2 && \
|
||||
useradd -M nginx && \
|
||||
cd /usr/local/nginx-${NGINX_VERSION}/ && \
|
||||
./configure --with-http_ssl_module --with-http_secure_link_module && make && make install && \
|
||||
mkdir -pv /usr/local/nginx/conf/conf.d && \
|
||||
mkdir -pv /storage/nginx_logs/ && chown -R nginx:nginx /storage/nginx_logs && \
|
||||
echo "ok" > /usr/local/nginx/html/index.html && \
|
||||
rm -rf /usr/local/nginx-${NGINX_VERSION}
|
||||
|
||||
COPY nginx.conf /usr/local/nginx/conf/
|
||||
COPY localhost.conf /usr/local/nginx/conf/conf.d/
|
||||
COPY 404.html 50x.html /usr/local/nginx/html
|
||||
EXPOSE 80 443
|
||||
CMD ["/usr/local/nginx/sbin/nginx","-g","daemon off;"]
|
||||
2
dockerfile/nginx/说明
Normal file
2
dockerfile/nginx/说明
Normal file
@@ -0,0 +1,2 @@
|
||||
配置 access /dev/strdout main; 可以把日志输出到控制台
|
||||
还没有测试
|
||||
Reference in New Issue
Block a user