FROM alpine:latest
ADD nginx-1.21.6.tar.gz /home/
ADD pcre-8.44.tar.gz /home/
ADD openssl-1.0.2q.tar.gz /home/
ADD zlib.tar.gz /home/
ADD v2.1.3.tar.gz /home/
RUN echo http://mirrors.aliyun.com/alpine/v3.10/main/ > /etc/apk/repositories && \
echo http://mirrors.aliyun.com/alpine/v3.10/community/ >> /etc/apk/repositories
RUN apk update && apk upgrade && \
apk add gcc g++ make && \
addgroup -S nginx && \
adduser -DHS -s /sbin/nologin -G nginx nginx && \
cd /home/nginx-1.21.6 && \
./configure --prefix=/usr/local/nginx --with-pcre=/home/pcre-8.44 --with-openssl=/home/openssl-1.0.2q --with-zlib=/home/zlib-1.3 --without-http_gzip_module --add-module=/home/nginx-upsync-module-2.1.3 && \
make && make install && \
ln -s /usr/local/nginx/sbin/nginx /usr/sbin/ && \
rm -rf /home/nginx-1.21.6 && \
rm -rf /home/pcre-8.44 && \
rm -rf /home/openssl-1.0.2q && \
rm -rf /home/zlib-1.3 && \
rm -rf /home/nginx-upsync-module-2.1.3 && \
apk del gcc && \
apk del g++ && \
rm -rf /apk/repositories && \
mkdir -p /usr/local/nginx/conf/vhost/
EXPOSE 80
CMD ["/usr/sbin/nginx","-g","daemon off;"]
docker build -t nginx:alpine .
docker run -d --name vcupsync -p 88:80 nginx:alpine
最好是让自己的网络可以访问外网这样apk update && apk upgrade时基本不会出现网络问题导致失败
这种就是网络问题导致的失败
所需资源包https://download.csdn.net/download/qq_30920479/88750435
上传到nexus私库
docker tag nginx:alpine 192.168.99.182:8082/nginx:alpine
docker login -u username -p password 192.168.99.182:8082
docker push 192.168.99.182:8082/nginx:alpine
?