dev-alpine.Dockerfile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # syntax=docker/dockerfile:1
  2. #checkov:skip=CKV_DOCKER_2
  3. #checkov:skip=CKV_DOCKER_3
  4. FROM golang:1.22-alpine
  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. pkgconfig \
  15. re2c"
  16. RUN apk add --no-cache \
  17. $PHPIZE_DEPS \
  18. argon2-dev \
  19. brotli-dev \
  20. curl-dev \
  21. oniguruma-dev \
  22. readline-dev \
  23. libsodium-dev \
  24. sqlite-dev \
  25. openssl-dev \
  26. libxml2-dev \
  27. zlib-dev \
  28. bison \
  29. nss-tools \
  30. # Dev tools \
  31. git \
  32. clang \
  33. llvm \
  34. gdb \
  35. valgrind \
  36. neovim \
  37. zsh \
  38. libtool && \
  39. echo 'set auto-load safe-path /' > /root/.gdbinit
  40. WORKDIR /usr/local/src/php
  41. RUN git clone --branch=PHP-8.3 https://github.com/php/php-src.git . && \
  42. # --enable-embed is only necessary to generate libphp.so, we don't use this SAPI directly
  43. ./buildconf --force && \
  44. ./configure \
  45. --enable-embed \
  46. --enable-zts \
  47. --disable-zend-signals \
  48. --enable-zend-max-execution-timers \
  49. --enable-debug && \
  50. make -j"$(nproc)" && \
  51. make install && \
  52. ldconfig /etc/ld.so.conf.d && \
  53. cp php.ini-development /usr/local/lib/php.ini && \
  54. echo "zend_extension=opcache.so" >> /usr/local/lib/php.ini && \
  55. echo "opcache.enable=1" >> /usr/local/lib/php.ini && \
  56. php --version
  57. WORKDIR /go/src/app
  58. COPY . .
  59. WORKDIR /go/src/app/caddy/frankenphp
  60. RUN go build
  61. WORKDIR /go/src/app
  62. CMD [ "zsh" ]