• Dockerfile制作http镜像(以alpine做底层镜像为例)


    [root@node0 ~]# tree httpd-installa
    httpd-installa
    ├── Dockerfile
    └── packages
        ├── apr-1.7.0.tar.gz
        ├── apr-util-1.6.1.tar.gz
        └── httpd-2.4.46.tar.bz2
    
    1 directory, 4 files
    
    
    [root@node0 ~]# cat httpd-installa/Dockerfile 
    FROM alpine:latest
    
    LABEL MAINTAINER "fxx fxx@123.com"
    
    ENV PATH /usr/local/apache/bin/:$PATH
    ENV aprver 1.7.0
    ENV aprutilver 1.6.1
    ENV apachever 2.4.46
    
    EXPOSE 80
    
    ADD packages/apr-${aprver}.tar.gz /usr/local/src
    ADD packages/apr-util-${aprutilver}.tar.gz /usr/local/src
    ADD packages/httpd-${apachever}.tar.bz2 /usr/local/src
    
    RUN adduser -SHs /sbin/nologin apache && 
        sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && 
        apk add --no-cache -U pcre-dev openssl openssl-dev libtool expat-dev libtool libxml2-dev gd-dev g++ make zlib-dev && 
        cd /usr/local/src/apr-${aprver} && ./configure --prefix=/usr/local/apr &&  
        make && make install && 
        cd /usr/local/src/apr-util-${aprutilver} &&  ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/ && 
        make && make install &&  
        cd /usr/local/src/httpd-${apachever} && 
        ./configure --prefix=/usr/local/apache 
        --sysconfdir=/etc/httpd24    
        --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 && 
        sed -i '/#ServerName/s/#//g' /etc/httpd24/httpd.conf && 
        ln -s /usr/local/apache/include/ /usr/include/httpd && 
        rm -rf /usr/local/src/*
    
    WORKDIR /usr/local/apache/
    
    CMD /usr/local/apache/bin/apachectl -DFOREGROUND
    
    
  • 相关阅读:
    keepalive高可用
    springboot中bean的重定义
    jni有关知识点总结
    java并发问题总结
    openoffice将word转pdf中文乱码或消失的坑
    Redis实现分布式锁(Set和Lua)
    Redis java使用
    Redis 分区
    Redis 管道技术
    Redis 连接
  • 原文地址:https://www.cnblogs.com/fangxinxin/p/14500441.html
Copyright © 2020-2023  润新知