树形结构
[root@localhost ~]# tree /apache/
/apache/
├── Dockerfile
├── files
│ ├── apr-1.7.0.tar.gz
│ ├── apr-util-1.6.1.tar.gz
│ └── httpd-2.4.51.tar.gz
└── httpd.conf
1 directory, 5 files
编写dockerfile文件
[root@localhost apache]# vim Dockerfile
[root@localhost apache]# cat Dockerfile
FROM centos
ENV apr_version 1.7.0
ENV apr_util_version 1.6.1
ENV httpd_version 2.4.51
LABEL MAINTAINER='harry1004 2252628021@qq.com'
ADD files/* /usr/src/
WORKDIR /usr/src/
RUN yum -y install openssl-devel pcre-devel pcre expat-devel libtool gcc gcc-c++ make && \
cd apr-$apr_version && \
./configure --prefix=/usr/local/apr && make && make install && \
cd ../apr-util-$apr_util_version && \
./configure --prefix=/usr/local/apr-util --with-apr=/usr