root@master1:nginx-base# ls
build-command.sh Dockerfile nginx-1.22.0.tar.gz
root@master1:nginx-base# cat build-command.sh
#!/bin/bash
docker build -t harbor.magedu.net/xiangmu/nginx-base:v1.22.0 .
docker push harbor.magedu.net/xiangmu/nginx-base:v1.22.0
root@master1:nginx-base# cat Dockerfile
#Nginx Base Image
FROM harbor.magedu.net/xiangmu/magedu-centos-base:7.9.2009
RUN yum install -y vim wget tree lrzsz gcc gcc-c++ automake pcre pcre-devel zlib zlib-devel openssl openssl-devel iproute net-tools iotop
ADD nginx-1.22.0.tar.gz /usr/local/src/
RUN cd /usr/local/src/nginx-1.22.0 && ./configure && make && make install && ln -sv /usr/local/nginx/sbin/nginx /usr/sbin/nginx &&rm -rf /usr/local/src/nginx-1.22.0.tar.gz
root@master1:nginx-base# bash build-command.sh