static-php-cli/docker/Dockerfile

76 lines
2.4 KiB
Docker
Raw Normal View History

2021-06-06 01:01:58 +08:00
FROM alpine:latest
2021-06-02 00:33:47 +08:00
2021-06-02 19:57:55 +08:00
# define script basic information
# Version of this Dockerfile
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
RUN if [ "${USE_BACKUP}" = "" ]; then \
export USE_BACKUP="no" ; \
2021-06-02 19:57:55 +08:00
fi
RUN if [ "${USE_BACKUP}" = "yes" ]; then \
echo "Using backup original address..." ; \
else \
echo "Using mirror address..." && \
sed -i 's/dl-cdn.alpinelinux.org/'${LINK_APK_REPO}'/g' /etc/apk/repositories ; \
fi
2021-06-02 19:57:55 +08:00
# build requirements
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
# 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
2021-06-02 00:33:47 +08:00
RUN mkdir /app
WORKDIR /app
COPY ./* /app/
2021-06-02 00:33:47 +08:00
RUN chmod +x /app/*.sh
2021-06-02 00:33:47 +08:00
RUN ./download.sh swoole ${USE_BACKUP} && \
./download.sh inotify ${USE_BACKUP} && \
./download.sh mongodb ${USE_BACKUP} && \
./download.sh event ${USE_BACKUP} && \
./download.sh redis ${USE_BACKUP} && \
./download.sh libxml2 ${USE_BACKUP} && \
./download.sh xz ${USE_BACKUP} && \
./download.sh curl ${USE_BACKUP} && \
./download.sh libzip ${USE_BACKUP} && \
2022-07-07 05:33:58 +00:00
./download.sh libiconv ${USE_BACKUP} && \
2022-06-20 20:52:35 +08:00
./download-git.sh dixyes/phpmicro phpmicro ${USE_BACKUP}
2021-06-02 19:57:55 +08:00
RUN ./compile-deps.sh
RUN echo -e "#!/usr/bin/env bash\n/app/compile-php.sh \$@" > /bin/build-php && chmod +x /bin/build-php