Dockerfile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. FROM golang
  2. ARG PHP_VERSION=8.1.5
  3. # Sury doesn't provide ZTS builds for now
  4. #RUN apt-get update && \
  5. # apt-get -y --no-install-recommends install apt-transport-https lsb-release&& \
  6. # wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \
  7. # sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' && \
  8. # apt-get update && \
  9. # apt-get -y --no-install-recommends install php8.1-dev && \
  10. # apt-get -y remove apt-transport-https lsb-release && \
  11. # apt-get clean all
  12. #ENV CGO_CFLAGS="-I /usr/include/php/20200930 -I /usr/include/php/20200930/Zend -I /usr/include/php/20200930/TSRM -I /usr/include/php/20200930/main -I /usr/include/php/20200930/sapi/embed"
  13. # TODO: check the downloaded package using the provided GPG signatures
  14. RUN apt-get update && \
  15. apt-get -y --no-install-recommends install libxml2 libxml2-dev sqlite3 libsqlite3-dev && \
  16. apt-get clean && \
  17. curl -s -o php-${PHP_VERSION}.tar.gz https://www.php.net/distributions/php-${PHP_VERSION}.tar.gz && \
  18. tar -xf php-${PHP_VERSION}.tar.gz && \
  19. cd php-${PHP_VERSION}/ && \
  20. # --enable-embed is only necessary to generate libphp.so, we don't use this SAPI directly
  21. ./configure --enable-zts --enable-embed --enable-debug && \
  22. make && \
  23. make install && \
  24. rm -Rf php-${PHP_VERSION}/ php-${PHP_VERSION}.tar.gz
  25. ENV LD_LIBRARY_PATH=/usr/local/lib/
  26. WORKDIR /go/src/app
  27. COPY . .
  28. RUN go get -d -v ./...
  29. RUN go build -v
  30. #RUN cd cmd/frankenphp && go install -v ./...
  31. #CMD ["frankenphp"]