Dockerfile制作httpd镜像

本文详细介绍了如何通过Dockerfile来创建一个基于CentOS的Apache HTTP服务器镜像,包括配置步骤和entrypoint.sh脚本的内容,旨在帮助读者理解Dockerfile的用法及其在部署httpd服务中的应用。
摘要由CSDN通过智能技术生成

Dockerfile文件内容

[root@localhost ~]# cd httpd/
[root@localhost httpd]# ls
Dockerfile  file
[root@localhost httpd]# 
[root@localhost httpd]# cd file/
[root@localhost file]# ls
apr-1.7.0.tar.gz  apr-util-1.6.1.tar.gz  httpd-2.4.52.tar.gz  httpd-2.4.54.tar.gz
[root@localhost file]# 

[root@localhost httpd]# vim Dockerfile 
[root@localhost httpd]# cat Dockerfile 
FROM  centos 

LABEL MAINTAINER='aliyonghu  xianshangxian@126.com'

ENV   apache_version 2.4.54
ENV   PATH  /usr/local/apache/bin:$PATH  


ADD   file/apr-1.7.0.tar.gz  /usr/src/
ADD   file/apr-util-1.6.1.tar.gz   /usr/src/
ADD   file/httpd-${apache_version}.tar.gz  /usr/src/   

RUN   useradd -r -M -s /sbin/nologin    apache && \
   cd /etc/yum.repos.d/ && rm -rf * && \
   curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo && \
   sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo && \
   yum clean all && yum makecache && \
   yum -y install gcc gcc-c++ make   openssl-devel pcre-devel expat-devel libtool  && \
   cd /usr/src/apr-1.7.0  && \
   sed -i '/$RM "$cfgfile"/d'  configure  && \
   ./configure --prefix=/usr/local/apr && \
   make && make install  && \
   cd ../apr-util-1.6.1  && \
   ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr   && \
   make && make install  && \
   cd ../httpd-${apache_version}  && \
   ./configure --prefix=/usr/local/apache \
        --enable-so \
        --enable-ssl \
        --enable-cgi \
        --enable-rewrite \
        --wit
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值