Created
July 24, 2021 10:08
-
-
Save informationsea/b56c83f0d313cca364ac7c460b6cdcba to your computer and use it in GitHub Desktop.
build apache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos:8 AS download-httpd | |
RUN dnf update -y | |
RUN dnf install -y bzip2 | |
ARG HTTPD_VERSION=2.4.48 | |
ARG APR_VERSION=1.7.0 | |
ARG APR_UTIL_VERSION=1.6.1 | |
RUN curl -OL https://ftp.tsukuba.wide.ad.jp/software/apache/httpd/httpd-${HTTPD_VERSION}.tar.bz2 | |
RUN curl -OL https://ftp.kddi-research.jp/infosystems/apache/apr/apr-${APR_VERSION}.tar.bz2 | |
RUN curl -OL https://ftp.kddi-research.jp/infosystems/apache/apr/apr-util-${APR_UTIL_VERSION}.tar.gz | |
RUN tar xjf httpd-${HTTPD_VERSION}.tar.bz2 | |
RUN tar xjf apr-${APR_VERSION}.tar.bz2 | |
RUN tar xzf apr-util-${APR_UTIL_VERSION}.tar.gz | |
FROM centos:8 | |
RUN dnf update -y | |
RUN dnf group install -y "Development Tools" | |
RUN dnf install -y expat-devel pcre-devel openssl-devel jansson-devel libcurl-devel | |
ARG HTTPD_VERSION=2.4.48 | |
ARG APR_VERSION=1.7.0 | |
ARG APR_UTIL_VERSION=1.6.1 | |
COPY --from=download-httpd /httpd-${HTTPD_VERSION} /build/httpd-${HTTPD_VERSION} | |
COPY --from=download-httpd /apr-${APR_VERSION} /build/apr-${APR_VERSION} | |
COPY --from=download-httpd /apr-util-${APR_UTIL_VERSION} /build/apr-util-${APR_UTIL_VERSION} | |
ARG PREFIX=/opt/httpd-${HTTPD_VERSION} | |
WORKDIR /build/apr-${APR_VERSION} | |
RUN ./configure --prefix=${PREFIX} | |
RUN make -j4 | |
RUN make install | |
WORKDIR /build/apr-util-${APR_UTIL_VERSION} | |
RUN ./configure --prefix=${PREFIX} --with-apr=${PREFIX} | |
RUN make -j4 | |
RUN make install | |
WORKDIR /build/httpd-${HTTPD_VERSION} | |
RUN ./configure --prefix=${PREFIX} --with-apr=${PREFIX} --with-apr-util=${PREFIX} | |
RUN make -j4 | |
RUN make install | |
WORKDIR ${PREFIX}/.. | |
RUN tar czf ./httpd-${HTTPD_VERSION}.tar.gz httpd-${HTTPD_VERSION} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment