[root@duanruhui ~]# ls
httpd
[root@duanruhui ~]# cd httpd/
[root@duanruhui httpd]# ls
Dockerfile sotfwar
[root@duanruhui httpd]# ls sotfware/
apr-1.7.0.tar.gz apr-util-1.6.1.tar.gz httpd-2.4.53.tar.gz
[root@duanruhui httpd]# cat Dockerfile
FROM centos
LABEL MAINTAINER <hejianglai 1251611916@qq.com>
ADD sotfware/*.gz /usr/src/
RUN rm -rf /etc/yum.repos.d/*
RUN curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
RUN sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
RUN yum -y install epel-release && yum -y install openssl-devel pcre-devel expat-devel libtool gcc gcc-c++ make && yum -y groups mark install 'Development Tools'
RUN cd /usr/src/apr-1.7.0 && ./configure --prefix=/usr/local/apr && make && make install && \
cd /usr/src/apr-util-1.6.1 && ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr && make && make install && \
cd /usr/src/httpd-2.4.53 && ./configure --prefix=/usr/local/apache \
--enable-so \
--enable-ssl \
--enable-cgi \
--enable-rewrite \
--with-zlib \
--with-pcre \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util/ \
--enable-modules=most \
--enable-mpms-shared=all \
--with-mpm=prefork &&\
make && make install && \
useradd -r -M -s /sbin/nologin apache && \
sed -i 's/$RM "$cfgfile"/# $RM "$cfgfile"/g' /usr/src/apr-1.7.0/configure
EXPOSE 80
CMD ["-D","FOREGROUND"]
ENTRYPOINT ["/usr/local/apache/bin/apachectl"]