2023-01-10 11:28:16 +08:00
|
|
|
FROM alpine:3.16
|
2021-06-02 00:33:47 +08:00
|
|
|
|
2021-06-02 19:57:55 +08:00
|
|
|
# define script basic information
|
|
|
|
|
# Version of this Dockerfile
|
2022-06-20 21:17:51 +08:00
|
|
|
ENV SCRIPT_VERSION=1.5.1
|
2021-06-02 19:57:55 +08:00
|
|
|
# Download address uses backup address
|
2021-08-30 17:08:37 +08:00
|
|
|
|
|
|
|
|
ARG USE_BACKUP_ADDRESS
|
|
|
|
|
|
2021-06-02 19:57:55 +08:00
|
|
|
# (if downloading slowly, consider set it to yes)
|
2021-08-30 17:02:18 +08:00
|
|
|
ENV USE_BACKUP="${USE_BACKUP_ADDRESS}"
|
2021-06-02 00:33:47 +08:00
|
|
|
|
2022-05-16 14:01:00 +08:00
|
|
|
|
2021-06-06 01:01:58 +08:00
|
|
|
# APK repositories mirror address, if u r not in China, consider set USE_BACKUP=yes to boost
|
2021-06-02 19:57:55 +08:00
|
|
|
ENV LINK_APK_REPO='mirrors.ustc.edu.cn'
|
|
|
|
|
ENV LINK_APK_REPO_BAK='dl-cdn.alpinelinux.org'
|
2021-06-02 00:33:47 +08:00
|
|
|
|
2022-06-11 01:09:45 +08:00
|
|
|
RUN if [ "${USE_BACKUP}" = "" ]; then \
|
|
|
|
|
export USE_BACKUP="no" ; \
|
2021-06-02 19:57:55 +08:00
|
|
|
fi
|
|
|
|
|
|
2023-03-03 19:19:54 +08:00
|
|
|
RUN sed -i.backup 's/dl-cdn.alpinelinux.org/'${LINK_APK_REPO}'/g' /etc/apk/repositories ;
|
2021-06-02 19:57:55 +08:00
|
|
|
|
2023-03-03 19:19:54 +08:00
|
|
|
RUN if [ "${USE_BACKUP}" = "no" ]; then cp -f /etc/apk/repositories.backup /etc/apk/repositories; fi
|
|
|
|
|
RUN cat /etc/apk/repositories
|
2021-06-02 19:57:55 +08:00
|
|
|
# build requirements
|
2022-06-11 01:09:45 +08:00
|
|
|
RUN apk add bash file wget cmake gcc g++ jq autoconf git libstdc++ linux-headers make m4 libgcc binutils ncurses dialog > /dev/null
|
2021-06-02 19:57:55 +08:00
|
|
|
# php zlib dependencies
|
2022-04-02 16:07:11 +08:00
|
|
|
RUN apk add zlib-dev zlib-static > /dev/null
|
2021-06-02 19:57:55 +08:00
|
|
|
# php mbstring dependencies
|
2022-04-02 16:07:11 +08:00
|
|
|
RUN apk add oniguruma-dev > /dev/null
|
2021-06-02 19:57:55 +08:00
|
|
|
# php openssl dependencies
|
2022-04-02 16:07:11 +08:00
|
|
|
RUN apk add openssl-libs-static openssl-dev openssl > /dev/null
|
2021-06-02 19:57:55 +08:00
|
|
|
# php gd dependencies
|
2022-04-02 16:07:11 +08:00
|
|
|
RUN apk add libpng-dev libpng-static > /dev/null
|
2021-06-02 19:57:55 +08:00
|
|
|
# curl c-ares dependencies
|
2022-04-02 16:07:11 +08:00
|
|
|
RUN apk add c-ares-static c-ares-dev > /dev/null
|
2021-06-06 01:01:58 +08:00
|
|
|
# php event dependencies
|
2022-04-02 16:07:11 +08:00
|
|
|
RUN apk add libevent libevent-dev libevent-static > /dev/null
|
2021-07-22 05:24:14 +00:00
|
|
|
# php sqlite3 dependencies
|
2022-04-02 16:07:11 +08:00
|
|
|
RUN apk add sqlite sqlite-dev sqlite-libs sqlite-static > /dev/null
|
2022-05-09 19:10:59 +08:00
|
|
|
# php libzip dependencies
|
2022-06-20 20:52:35 +08:00
|
|
|
RUN apk add bzip2-dev bzip2-static bzip2 > /dev/null
|
2022-05-16 14:01:00 +08:00
|
|
|
# php micro ffi dependencies
|
2022-06-20 20:52:35 +08:00
|
|
|
RUN apk add libffi libffi-dev > /dev/null
|
|
|
|
|
# php gd event parent dependencies
|
|
|
|
|
RUN apk add zstd-static > /dev/null
|
|
|
|
|
# php readline dependencies
|
|
|
|
|
RUN apk add readline-static ncurses-static readline-dev > /dev/null
|
2023-03-03 19:19:54 +08:00
|
|
|
RUN apk add aria2
|
2021-06-02 00:33:47 +08:00
|
|
|
|
|
|
|
|
RUN mkdir /app
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
2023-03-03 19:19:54 +08:00
|
|
|
ADD ./ /app/
|
|
|
|
|
|
|
|
|
|
# RUN chmod +x /app/*.sh
|
|
|
|
|
|
|
|
|
|
# use proxy
|
|
|
|
|
# ENV http_proxy=http://192.168.3.26:8015
|
|
|
|
|
# ENV https_proxy=http://192.168.3.26:8015
|
|
|
|
|
|
|
|
|
|
# 提前下载好,就可以跳过两步
|
|
|
|
|
# (容器外提前执行 下面两个命令)
|
|
|
|
|
RUN sh ./download-library-batch-aria2.sh
|
|
|
|
|
RUN sh ./download-extension-batch-aria2.sh
|
2021-06-02 00:33:47 +08:00
|
|
|
|
2023-03-03 19:19:54 +08:00
|
|
|
#ENV http_proxy=''
|
|
|
|
|
#ENV https_proxy=''
|
|
|
|
|
RUN ls -lh source/libraries
|
|
|
|
|
RUN ls -lh source/extensions
|
|
|
|
|
# quick test complie
|
|
|
|
|
# RUN bash ./compile-deps.sh
|
2021-06-02 00:33:47 +08:00
|
|
|
|
2023-03-03 19:19:54 +08:00
|
|
|
RUN sh ./download.sh swoole ${USE_BACKUP} && \
|
|
|
|
|
sh ./download.sh inotify ${USE_BACKUP} && \
|
|
|
|
|
sh ./download.sh mongodb ${USE_BACKUP} && \
|
|
|
|
|
sh ./download.sh event ${USE_BACKUP} && \
|
|
|
|
|
sh ./download.sh redis ${USE_BACKUP} && \
|
|
|
|
|
sh ./download.sh libxml2 ${USE_BACKUP} && \
|
|
|
|
|
sh ./download.sh xz ${USE_BACKUP} && \
|
|
|
|
|
sh ./download.sh curl ${USE_BACKUP} && \
|
|
|
|
|
sh ./download.sh libzip ${USE_BACKUP} && \
|
|
|
|
|
sh ./download.sh libiconv ${USE_BACKUP} && \
|
|
|
|
|
sh ./download-git.sh dixyes/phpmicro phpmicro ${USE_BACKUP}
|
2021-06-02 19:57:55 +08:00
|
|
|
|
2023-03-03 19:19:54 +08:00
|
|
|
RUN bash ./compile-deps.sh
|
2022-06-11 01:09:45 +08:00
|
|
|
RUN echo -e "#!/usr/bin/env bash\n/app/compile-php.sh \$@" > /bin/build-php && chmod +x /bin/build-php
|