Dockerfile 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. FROM alpine:3.16
  2. # define script basic information
  3. # Version of this Dockerfile
  4. ENV SCRIPT_VERSION=1.5.1
  5. # Download address uses backup address
  6. ARG USE_BACKUP_ADDRESS
  7. # (if downloading slowly, consider set it to yes)
  8. ENV USE_BACKUP="${USE_BACKUP_ADDRESS}"
  9. # APK repositories mirror address, if u r not in China, consider set USE_BACKUP=yes to boost
  10. ENV LINK_APK_REPO='mirrors.ustc.edu.cn'
  11. ENV LINK_APK_REPO_BAK='dl-cdn.alpinelinux.org'
  12. RUN if [ "${USE_BACKUP}" = "" ]; then \
  13. export USE_BACKUP="no" ; \
  14. fi
  15. RUN sed -i.backup 's/dl-cdn.alpinelinux.org/'${LINK_APK_REPO}'/g' /etc/apk/repositories ;
  16. RUN if [ "${USE_BACKUP}" = "no" ]; then cp -f /etc/apk/repositories.backup /etc/apk/repositories; fi
  17. RUN cat /etc/apk/repositories
  18. # build requirements
  19. RUN apk add bash file wget cmake gcc g++ jq autoconf git libstdc++ linux-headers make m4 libgcc binutils ncurses dialog > /dev/null
  20. # php zlib dependencies
  21. RUN apk add zlib-dev zlib-static > /dev/null
  22. # php mbstring dependencies
  23. RUN apk add oniguruma-dev > /dev/null
  24. # php openssl dependencies
  25. RUN apk add openssl-libs-static openssl-dev openssl > /dev/null
  26. # php gd dependencies
  27. RUN apk add libpng-dev libpng-static > /dev/null
  28. # curl c-ares dependencies
  29. RUN apk add c-ares-static c-ares-dev > /dev/null
  30. # php event dependencies
  31. RUN apk add libevent libevent-dev libevent-static > /dev/null
  32. # php sqlite3 dependencies
  33. RUN apk add sqlite sqlite-dev sqlite-libs sqlite-static > /dev/null
  34. # php libzip dependencies
  35. RUN apk add bzip2-dev bzip2-static bzip2 > /dev/null
  36. # php micro ffi dependencies
  37. RUN apk add libffi libffi-dev > /dev/null
  38. # php gd event parent dependencies
  39. RUN apk add zstd-static > /dev/null
  40. # php readline dependencies
  41. RUN apk add readline-static ncurses-static readline-dev > /dev/null
  42. RUN apk add aria2
  43. RUN mkdir /app
  44. WORKDIR /app
  45. ADD ./ /app/
  46. # RUN chmod +x /app/*.sh
  47. # use proxy
  48. # ENV http_proxy=http://192.168.3.26:8015
  49. # ENV https_proxy=http://192.168.3.26:8015
  50. # 提前下载好,就可以跳过两步
  51. # (容器外提前执行 下面两个命令)
  52. RUN sh ./download-library-batch-aria2.sh
  53. RUN sh ./download-extension-batch-aria2.sh
  54. #ENV http_proxy=''
  55. #ENV https_proxy=''
  56. RUN ls -lh source/libraries
  57. RUN ls -lh source/extensions
  58. # quick test complie
  59. # RUN bash ./compile-deps.sh
  60. RUN sh ./download.sh swoole ${USE_BACKUP} && \
  61. sh ./download.sh inotify ${USE_BACKUP} && \
  62. sh ./download.sh mongodb ${USE_BACKUP} && \
  63. sh ./download.sh event ${USE_BACKUP} && \
  64. sh ./download.sh redis ${USE_BACKUP} && \
  65. sh ./download.sh libxml2 ${USE_BACKUP} && \
  66. sh ./download.sh xz ${USE_BACKUP} && \
  67. sh ./download.sh curl ${USE_BACKUP} && \
  68. sh ./download.sh libzip ${USE_BACKUP} && \
  69. sh ./download.sh libiconv ${USE_BACKUP} && \
  70. sh ./download-git.sh dixyes/phpmicro phpmicro ${USE_BACKUP}
  71. RUN bash ./compile-deps.sh
  72. RUN echo -e "#!/usr/bin/env bash\n/app/compile-php.sh \$@" > /bin/build-php && chmod +x /bin/build-php