dev.Dockerfile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # syntax=docker/dockerfile:1
  2. #checkov:skip=CKV_DOCKER_2
  3. #checkov:skip=CKV_DOCKER_3
  4. FROM golang:1.22
  5. ENV CFLAGS="-ggdb3"
  6. ENV PHPIZE_DEPS="\
  7. autoconf \
  8. dpkg-dev \
  9. file \
  10. g++ \
  11. gcc \
  12. libc-dev \
  13. make \
  14. pkg-config \
  15. re2c"
  16. # hadolint ignore=DL3009
  17. RUN apt-get update && \
  18. apt-get -y --no-install-recommends install \
  19. $PHPIZE_DEPS \
  20. libargon2-dev \
  21. libbrotli-dev \
  22. libcurl4-openssl-dev \
  23. libonig-dev \
  24. libreadline-dev \
  25. libsodium-dev \
  26. libsqlite3-dev \
  27. libssl-dev \
  28. libxml2-dev \
  29. zlib1g-dev \
  30. bison \
  31. libnss3-tools \
  32. # Dev tools \
  33. git \
  34. clang \
  35. llvm \
  36. gdb \
  37. valgrind \
  38. neovim \
  39. zsh \
  40. libtool-bin && \
  41. echo 'set auto-load safe-path /' > /root/.gdbinit && \
  42. echo '* soft core unlimited' >> /etc/security/limits.conf \
  43. && \
  44. apt-get clean
  45. WORKDIR /usr/local/src/php
  46. RUN git clone --branch=PHP-8.3 https://github.com/php/php-src.git . && \
  47. # --enable-embed is only necessary to generate libphp.so, we don't use this SAPI directly
  48. ./buildconf --force && \
  49. ./configure \
  50. --enable-embed \
  51. --enable-zts \
  52. --disable-zend-signals \
  53. --enable-zend-max-execution-timers \
  54. --enable-debug && \
  55. make -j"$(nproc)" && \
  56. make install && \
  57. ldconfig && \
  58. cp php.ini-development /usr/local/lib/php.ini && \
  59. echo "zend_extension=opcache.so" >> /usr/local/lib/php.ini && \
  60. echo "opcache.enable=1" >> /usr/local/lib/php.ini && \
  61. php --version
  62. WORKDIR /go/src/app
  63. COPY . .
  64. WORKDIR /go/src/app/caddy/frankenphp
  65. RUN go build -buildvcs=false
  66. WORKDIR /go/src/app
  67. CMD [ "zsh" ]