From a85945a1074f4b706bf3dab2a281a46ccedf543e Mon Sep 17 00:00:00 2001 From: cytopia Date: Fri, 18 Mar 2022 20:56:36 +0100 Subject: [PATCH 1/4] New images --- .github/workflows/action_branch.yml | 2 +- .github/workflows/action_pull_request.yml | 2 +- .github/workflows/action_schedule.yml | 2 +- .github/workflows/params.yml | 1 + Dockerfile | 136 ------------- Dockerfiles/Dockerfile.jessie | 187 +++++++++++++++++ Dockerfiles/Dockerfile.latest | 187 +++++++++++++++++ Dockerfiles/Dockerfile.stretch | 190 ++++++++++++++++++ .../data}/docker-php-ext-configure | 0 .../data}/docker-php-ext-enable | 0 .../data}/docker-php-ext-install | 0 {data => Dockerfiles/data}/docker-php-source | 0 {data => Dockerfiles/data}/php-fpm.conf | 0 {data => Dockerfiles/data}/php.ini | 0 Makefile | 17 +- README.md | 19 ++ 16 files changed, 600 insertions(+), 143 deletions(-) delete mode 100644 Dockerfile create mode 100644 Dockerfiles/Dockerfile.jessie create mode 100644 Dockerfiles/Dockerfile.latest create mode 100644 Dockerfiles/Dockerfile.stretch rename {data => Dockerfiles/data}/docker-php-ext-configure (100%) rename {data => Dockerfiles/data}/docker-php-ext-enable (100%) rename {data => Dockerfiles/data}/docker-php-ext-install (100%) rename {data => Dockerfiles/data}/docker-php-source (100%) rename {data => Dockerfiles/data}/php-fpm.conf (100%) rename {data => Dockerfiles/data}/php.ini (100%) diff --git a/.github/workflows/action_branch.yml b/.github/workflows/action_branch.yml index 55d6950..3197415 100644 --- a/.github/workflows/action_branch.yml +++ b/.github/workflows/action_branch.yml @@ -22,7 +22,7 @@ jobs: # (2/2) Build docker: needs: [params] - uses: devilbox/github-actions/.github/workflows/docker-name-version-arch.yml@master + uses: devilbox/github-actions/.github/workflows/docker-name-version-flavour-arch.yml@master with: enabled: true can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }} diff --git a/.github/workflows/action_pull_request.yml b/.github/workflows/action_pull_request.yml index c80bf78..21b075b 100644 --- a/.github/workflows/action_pull_request.yml +++ b/.github/workflows/action_pull_request.yml @@ -24,7 +24,7 @@ jobs: # (2/2) Build docker: needs: [params] - uses: devilbox/github-actions/.github/workflows/docker-name-version-arch.yml@master + uses: devilbox/github-actions/.github/workflows/docker-name-version-flavour-arch.yml@master with: enabled: true can_deploy: false diff --git a/.github/workflows/action_schedule.yml b/.github/workflows/action_schedule.yml index 36d979a..c25dfa2 100644 --- a/.github/workflows/action_schedule.yml +++ b/.github/workflows/action_schedule.yml @@ -24,7 +24,7 @@ jobs: # (2/2) Build docker: needs: [params] - uses: devilbox/github-actions/.github/workflows/docker-name-version-arch.yml@master + uses: devilbox/github-actions/.github/workflows/docker-name-version-flavour-arch.yml@master with: enabled: true can_deploy: true diff --git a/.github/workflows/params.yml b/.github/workflows/params.yml index fb2b24e..f22c70d 100644 --- a/.github/workflows/params.yml +++ b/.github/workflows/params.yml @@ -15,6 +15,7 @@ env: { "NAME": "PHP", "VERSION": ["5.3"], + "FLAVOUR": ["jessie", "stretch", "latest"], "ARCH": ["linux/amd64", "linux/386", "linux/arm64", "linux/arm/v7", "linux/arm/v6"] } ] diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 20b58d6..0000000 --- a/Dockerfile +++ /dev/null @@ -1,136 +0,0 @@ -FROM debian:stretch -MAINTAINER "cytopia" - -# persistent / runtime deps -RUN set -eux \ - && DEBIAN_FRONTEND=noninteractive apt-get update -qq \ - && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \ - ca-certificates \ - curl \ - libpcre3 \ - librecode0 \ - libmariadbclient-dev-compat \ - libsqlite3-0 \ - libxml2 \ - && DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - && rm -rf /var/lib/apt/lists/* - -# phpize deps -RUN set -eux \ - && DEBIAN_FRONTEND=noninteractive apt-get update -qq \ - && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \ - autoconf \ - file \ - dpkg-dev \ - g++ \ - gcc \ - libc-dev \ - make \ - pkg-config \ - re2c \ - xz-utils \ - && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ - DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \ - g++-multilib \ - gcc-multilib; \ - fi \ - && DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - && rm -rf /var/lib/apt/lists/* - -ENV PHP_INI_DIR /usr/local/etc/php -RUN mkdir -p $PHP_INI_DIR/conf.d - -# compile openssl, otherwise --with-openssl won't work -RUN set -eux \ - && OPENSSL_VERSION="1.0.1t" \ - && cd /tmp \ - && mkdir openssl \ - && update-ca-certificates \ - && curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" -o openssl.tar.gz \ - && curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz.asc" -o openssl.tar.gz.asc \ - && tar -xzf openssl.tar.gz -C openssl --strip-components=1 \ - && cd /tmp/openssl \ - && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ - setarch i386 ./config -m32; \ - else \ - ./config; \ - fi \ - && make depend \ - && make -j"$(nproc)" \ - && make install \ - && rm -rf /tmp/* - -ENV PHP_VERSION 5.3.29 -COPY data/docker-php-source /usr/local/bin/ - -# php 5.3 needs older autoconf -# --enable-mysqlnd is included below because it's harder to compile after the fact the extensions are (since it's a plugin for several extensions, not an extension in itself) -RUN set -eux \ - && buildDeps=" \ - autoconf2.13 \ - libcurl4-openssl-dev \ - libpcre3-dev \ - libreadline6-dev \ - librecode-dev \ - libsqlite3-dev \ - libssl-dev \ - libxml2-dev \ - " \ - && DEBIAN_FRONTEND=noninteractive apt-get update -qq \ - && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests \ - ${buildDeps} \ - && DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - && rm -rf /var/lib/apt/lists/* \ - \ - && mkdir -p /usr/src/php \ - && curl -sS -k -L --fail "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o /usr/src/php.tar.xz \ - && curl -sS -k -L --fail "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o /usr/src/php.tar.xz.asc \ - && docker-php-source extract \ - && cd /usr/src/php \ - \ - && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ - && debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \ - \ - # Fix libmariadbclient lib location - && find /usr/lib/ -name '*mariadbclient*' | xargs -n1 sh -c 'ln -s "${1}" "/usr/lib/$( basename "${1}" | sed "s|libmariadbclient|libmysqlclient|g" )"' -- \ - \ - # https://bugs.php.net/bug.php?id=74125 - && if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; \ - fi \ - \ - && ./configure \ - --host="${gnuArch}" \ - --with-config-file-path="$PHP_INI_DIR" \ - --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \ - --enable-fpm \ - --with-fpm-user=www-data \ - --with-fpm-group=www-data \ - --disable-cgi \ - --enable-mysqlnd \ - --with-mysql \ - --with-curl \ - --with-openssl=/usr/local/ssl \ - --with-readline \ - --with-recode \ - --with-zlib \ - && make -j"$(nproc)" \ - && make install \ - && make clean \ - \ - && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ - \ - && cd / \ - && docker-php-source delete \ - \ - && DEBIAN_FRONTEND=noninteractive apt-get purge -qq -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ${buildDeps} \ - && rm -rf /var/lib/apt/lists/* - -COPY data/docker-php-* /usr/local/bin/ - -WORKDIR /var/www/html -COPY data/php-fpm.conf /usr/local/etc/ -COPY data/php.ini /usr/local/etc/php/php.ini - -EXPOSE 9000 -CMD ["php-fpm"] diff --git a/Dockerfiles/Dockerfile.jessie b/Dockerfiles/Dockerfile.jessie new file mode 100644 index 0000000..b08614c --- /dev/null +++ b/Dockerfiles/Dockerfile.jessie @@ -0,0 +1,187 @@ +FROM debian:jessie-slim +MAINTAINER "cytopia" + + +ENV PHP_VERSION=5.3.29 +ENV PHP_INI_DIR=/usr/local/etc/php + +ENV OPENSSL_VERSION=1.0.1t + +ENV PHP_BUILD_DEPS \ + autoconf2.13 \ + libbison-dev \ + libcurl4-openssl-dev \ + libfl-dev \ + libmysqlclient-dev \ + libpcre3-dev \ + libreadline6-dev \ + librecode-dev \ + libsqlite3-dev \ + libssl-dev \ + libxml2-dev + +ENV PHP_RUNTIME_DEPS \ + libmysqlclient18 \ + libpcre3 \ + librecode0 \ + libsqlite3-0 \ + libssl1.0.0 \ + libxml2 \ + xz-utils + +ENV BUILD_TOOLS \ + autoconf \ + ca-certificates \ + curl \ + dpkg-dev \ + file \ + flex \ + g++ \ + gcc \ + libc-dev \ + make \ + patch \ + pkg-config \ + re2c \ + xz-utils + +ENV BUILD_TOOLS_32 \ + g++-multilib \ + gcc-multilib + +ENV RUNTIME_TOOLS \ + ca-certificates \ + curl + + +### +### Build OpenSSL +### +RUN set -eux \ +# Install Dependencies + && apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + ${BUILD_TOOLS} \ + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + apt-get install -y --no-install-recommends --no-install-suggests \ + ${BUILD_TOOLS_32}; \ + fi \ +# Fetch OpenSSL + && cd /tmp \ + && mkdir openssl \ + && update-ca-certificates \ + && curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" -o openssl.tar.gz \ + && curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz.asc" -o openssl.tar.gz.asc \ + && tar -xzf openssl.tar.gz -C openssl --strip-components=1 \ + && cd /tmp/openssl \ +# Build OpenSSL + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + setarch i386 ./config -m32; \ + else \ + ./config; \ + fi \ + && make depend \ + && make -j"$(nproc)" \ + && make install \ +# Cleanup + && rm -rf /tmp/* \ +# Ensure libs are linked to correct architecture directory + && debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \ + && mkdir -p "/usr/local/ssl/lib/${debMultiarch}" \ + && ln -s /usr/local/ssl/lib/* "/usr/local/ssl/lib/${debMultiarch}/" \ +# Remove Dependencies + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ + ${BUILD_TOOLS} \ + ${BUILD_TOOLS_32} \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + + +### +### Setup PHP directories +### +RUN set -eux \ + && mkdir -p ${PHP_INI_DIR}/conf.d \ + && mkdir -p /usr/src/php + + +### +### Copy PHP scripts +### +COPY data/docker-php-source /usr/local/bin/ + + +### +### Build PHP +### +RUN set -eux \ +# Install Dependencies + && apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + ${PHP_BUILD_DEPS} \ + ${BUILD_TOOLS} \ + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + apt-get install -y --no-install-recommends --no-install-suggests \ + ${BUILD_TOOLS_32}; \ + fi \ +# Fetch PHP + && curl -sS -k -L --fail "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o /usr/src/php.tar.xz \ + && curl -sS -k -L --fail "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o /usr/src/php.tar.xz.asc \ +# Setup Requirements + && docker-php-source extract \ + && cd /usr/src/php \ + \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \ + \ + # https://bugs.php.net/bug.php?id=74125 + && if [ ! -d /usr/include/curl ]; then \ + ln -sT "/usr/include/${debMultiarch}/curl" /usr/local/include/curl; \ + fi \ +# Build PHP + && ./configure \ + --host="${gnuArch}" \ + --with-libdir="/lib/${debMultiarch}/" \ + --with-config-file-path="${PHP_INI_DIR}" \ + --with-config-file-scan-dir="${PHP_INI_DIR}/conf.d" \ + --enable-fpm \ + --with-fpm-user=www-data \ + --with-fpm-group=www-data \ + --disable-cgi \ + --enable-mysqlnd \ + --enable-pdo \ + --with-mysql \ + --with-mysqli \ + --with-curl \ + --with-openssl=/usr/local/ssl \ + --with-readline \ + --with-recode \ + --with-zlib \ + && make -j"$(nproc)" \ + && make install \ +# Cleanup + && make clean \ + && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ + && docker-php-source delete \ +# Remove Dependencies + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ + ${PHP_BUILD_DEPS} \ + ${BUILD_TOOLS} \ + ${BUILD_TOOLS_32} \ +# Install Run-time requirements + && apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + ${PHP_RUNTIME_DEPS} \ + ${RUNTIME_TOOLS} \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + + +COPY data/docker-php-* /usr/local/bin/ + +WORKDIR /var/www/html +COPY data/php-fpm.conf /usr/local/etc/ +COPY data/php.ini /usr/local/etc/php/php.ini + +EXPOSE 9000 +CMD ["php-fpm"] diff --git a/Dockerfiles/Dockerfile.latest b/Dockerfiles/Dockerfile.latest new file mode 100644 index 0000000..b08614c --- /dev/null +++ b/Dockerfiles/Dockerfile.latest @@ -0,0 +1,187 @@ +FROM debian:jessie-slim +MAINTAINER "cytopia" + + +ENV PHP_VERSION=5.3.29 +ENV PHP_INI_DIR=/usr/local/etc/php + +ENV OPENSSL_VERSION=1.0.1t + +ENV PHP_BUILD_DEPS \ + autoconf2.13 \ + libbison-dev \ + libcurl4-openssl-dev \ + libfl-dev \ + libmysqlclient-dev \ + libpcre3-dev \ + libreadline6-dev \ + librecode-dev \ + libsqlite3-dev \ + libssl-dev \ + libxml2-dev + +ENV PHP_RUNTIME_DEPS \ + libmysqlclient18 \ + libpcre3 \ + librecode0 \ + libsqlite3-0 \ + libssl1.0.0 \ + libxml2 \ + xz-utils + +ENV BUILD_TOOLS \ + autoconf \ + ca-certificates \ + curl \ + dpkg-dev \ + file \ + flex \ + g++ \ + gcc \ + libc-dev \ + make \ + patch \ + pkg-config \ + re2c \ + xz-utils + +ENV BUILD_TOOLS_32 \ + g++-multilib \ + gcc-multilib + +ENV RUNTIME_TOOLS \ + ca-certificates \ + curl + + +### +### Build OpenSSL +### +RUN set -eux \ +# Install Dependencies + && apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + ${BUILD_TOOLS} \ + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + apt-get install -y --no-install-recommends --no-install-suggests \ + ${BUILD_TOOLS_32}; \ + fi \ +# Fetch OpenSSL + && cd /tmp \ + && mkdir openssl \ + && update-ca-certificates \ + && curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" -o openssl.tar.gz \ + && curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz.asc" -o openssl.tar.gz.asc \ + && tar -xzf openssl.tar.gz -C openssl --strip-components=1 \ + && cd /tmp/openssl \ +# Build OpenSSL + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + setarch i386 ./config -m32; \ + else \ + ./config; \ + fi \ + && make depend \ + && make -j"$(nproc)" \ + && make install \ +# Cleanup + && rm -rf /tmp/* \ +# Ensure libs are linked to correct architecture directory + && debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \ + && mkdir -p "/usr/local/ssl/lib/${debMultiarch}" \ + && ln -s /usr/local/ssl/lib/* "/usr/local/ssl/lib/${debMultiarch}/" \ +# Remove Dependencies + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ + ${BUILD_TOOLS} \ + ${BUILD_TOOLS_32} \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + + +### +### Setup PHP directories +### +RUN set -eux \ + && mkdir -p ${PHP_INI_DIR}/conf.d \ + && mkdir -p /usr/src/php + + +### +### Copy PHP scripts +### +COPY data/docker-php-source /usr/local/bin/ + + +### +### Build PHP +### +RUN set -eux \ +# Install Dependencies + && apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + ${PHP_BUILD_DEPS} \ + ${BUILD_TOOLS} \ + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + apt-get install -y --no-install-recommends --no-install-suggests \ + ${BUILD_TOOLS_32}; \ + fi \ +# Fetch PHP + && curl -sS -k -L --fail "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o /usr/src/php.tar.xz \ + && curl -sS -k -L --fail "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o /usr/src/php.tar.xz.asc \ +# Setup Requirements + && docker-php-source extract \ + && cd /usr/src/php \ + \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \ + \ + # https://bugs.php.net/bug.php?id=74125 + && if [ ! -d /usr/include/curl ]; then \ + ln -sT "/usr/include/${debMultiarch}/curl" /usr/local/include/curl; \ + fi \ +# Build PHP + && ./configure \ + --host="${gnuArch}" \ + --with-libdir="/lib/${debMultiarch}/" \ + --with-config-file-path="${PHP_INI_DIR}" \ + --with-config-file-scan-dir="${PHP_INI_DIR}/conf.d" \ + --enable-fpm \ + --with-fpm-user=www-data \ + --with-fpm-group=www-data \ + --disable-cgi \ + --enable-mysqlnd \ + --enable-pdo \ + --with-mysql \ + --with-mysqli \ + --with-curl \ + --with-openssl=/usr/local/ssl \ + --with-readline \ + --with-recode \ + --with-zlib \ + && make -j"$(nproc)" \ + && make install \ +# Cleanup + && make clean \ + && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ + && docker-php-source delete \ +# Remove Dependencies + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ + ${PHP_BUILD_DEPS} \ + ${BUILD_TOOLS} \ + ${BUILD_TOOLS_32} \ +# Install Run-time requirements + && apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + ${PHP_RUNTIME_DEPS} \ + ${RUNTIME_TOOLS} \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + + +COPY data/docker-php-* /usr/local/bin/ + +WORKDIR /var/www/html +COPY data/php-fpm.conf /usr/local/etc/ +COPY data/php.ini /usr/local/etc/php/php.ini + +EXPOSE 9000 +CMD ["php-fpm"] diff --git a/Dockerfiles/Dockerfile.stretch b/Dockerfiles/Dockerfile.stretch new file mode 100644 index 0000000..7a2ddab --- /dev/null +++ b/Dockerfiles/Dockerfile.stretch @@ -0,0 +1,190 @@ +FROM debian:stretch-slim +MAINTAINER "cytopia" + + +ENV PHP_VERSION=5.3.29 +ENV PHP_INI_DIR=/usr/local/etc/php + +ENV OPENSSL_VERSION=1.0.1t + +ENV PHP_BUILD_DEPS \ + autoconf2.13 \ + libbison-dev \ + libcurl4-openssl-dev \ + libfl-dev \ + libmariadbclient-dev-compat \ + libpcre3-dev \ + libreadline6-dev \ + librecode-dev \ + libsqlite3-dev \ + libssl-dev \ + libxml2-dev + +ENV PHP_RUNTIME_DEPS \ + libmariadbclient-dev-compat \ + libpcre3 \ + librecode0 \ + libsqlite3-0 \ + libssl1.0.2 \ + libxml2 \ + xz-utils + +ENV BUILD_TOOLS \ + autoconf \ + ca-certificates \ + curl \ + dpkg-dev \ + file \ + flex \ + g++ \ + gcc \ + libc-dev \ + make \ + patch \ + pkg-config \ + re2c \ + xz-utils + +ENV BUILD_TOOLS_32 \ + g++-multilib \ + gcc-multilib + +ENV RUNTIME_TOOLS \ + ca-certificates \ + curl + + +### +### Build OpenSSL +### +RUN set -eux \ +# Install Dependencies + && apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + ${BUILD_TOOLS} \ + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + apt-get install -y --no-install-recommends --no-install-suggests \ + ${BUILD_TOOLS_32}; \ + fi \ +# Fetch OpenSSL + && cd /tmp \ + && mkdir openssl \ + && update-ca-certificates \ + && curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" -o openssl.tar.gz \ + && curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz.asc" -o openssl.tar.gz.asc \ + && tar -xzf openssl.tar.gz -C openssl --strip-components=1 \ + && cd /tmp/openssl \ +# Build OpenSSL + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + setarch i386 ./config -m32; \ + else \ + ./config; \ + fi \ + && make depend \ + && make -j"$(nproc)" \ + && make install \ +# Cleanup + && rm -rf /tmp/* \ +# Ensure libs are linked to correct architecture directory + && debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \ + && mkdir -p "/usr/local/ssl/lib/${debMultiarch}" \ + && ln -s /usr/local/ssl/lib/* "/usr/local/ssl/lib/${debMultiarch}/" \ +# Remove Dependencies + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ + ${BUILD_TOOLS} \ + ${BUILD_TOOLS_32} \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + + +### +### Setup PHP directories +### +RUN set -eux \ + && mkdir -p ${PHP_INI_DIR}/conf.d \ + && mkdir -p /usr/src/php + + +### +### Copy PHP scripts +### +COPY data/docker-php-source /usr/local/bin/ + + +### +### Build PHP +### +RUN set -eux \ +# Install Dependencies + && apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + ${PHP_BUILD_DEPS} \ + ${BUILD_TOOLS} \ + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + apt-get install -y --no-install-recommends --no-install-suggests \ + ${BUILD_TOOLS_32}; \ + fi \ +# Fetch PHP + && curl -sS -k -L --fail "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o /usr/src/php.tar.xz \ + && curl -sS -k -L --fail "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o /usr/src/php.tar.xz.asc \ +# Setup Requirements + && docker-php-source extract \ + && cd /usr/src/php \ + \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \ + \ + # Fix libmariadbclient lib location + && find /usr/lib/ -name '*mariadbclient*' | xargs -n1 sh -c 'ln -s "${1}" "/usr/lib/$( basename "${1}" | sed "s|libmariadbclient|libmysqlclient|g" )"' -- \ + \ + # https://bugs.php.net/bug.php?id=74125 + && if [ ! -d /usr/include/curl ]; then \ + ln -sT "/usr/include/${debMultiarch}/curl" /usr/local/include/curl; \ + fi \ +# Build PHP + && ./configure \ + --host="${gnuArch}" \ + --with-libdir="/lib/${debMultiarch}/" \ + --with-config-file-path="${PHP_INI_DIR}" \ + --with-config-file-scan-dir="${PHP_INI_DIR}/conf.d" \ + --enable-fpm \ + --with-fpm-user=www-data \ + --with-fpm-group=www-data \ + --disable-cgi \ + --enable-mysqlnd \ + --enable-pdo \ + --with-mysql \ + --with-mysqli \ + --with-curl \ + --with-openssl=/usr/local/ssl \ + --with-readline \ + --with-recode \ + --with-zlib \ + && make -j"$(nproc)" \ + && make install \ +# Cleanup + && make clean \ + && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ + && docker-php-source delete \ +# Remove Dependencies + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ + ${PHP_BUILD_DEPS} \ + ${BUILD_TOOLS} \ + ${BUILD_TOOLS_32} \ +# Install Run-time requirements + && apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + ${PHP_RUNTIME_DEPS} \ + ${RUNTIME_TOOLS} \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + + +COPY data/docker-php-* /usr/local/bin/ + +WORKDIR /var/www/html +COPY data/php-fpm.conf /usr/local/etc/ +COPY data/php.ini /usr/local/etc/php/php.ini + +EXPOSE 9000 +CMD ["php-fpm"] diff --git a/data/docker-php-ext-configure b/Dockerfiles/data/docker-php-ext-configure similarity index 100% rename from data/docker-php-ext-configure rename to Dockerfiles/data/docker-php-ext-configure diff --git a/data/docker-php-ext-enable b/Dockerfiles/data/docker-php-ext-enable similarity index 100% rename from data/docker-php-ext-enable rename to Dockerfiles/data/docker-php-ext-enable diff --git a/data/docker-php-ext-install b/Dockerfiles/data/docker-php-ext-install similarity index 100% rename from data/docker-php-ext-install rename to Dockerfiles/data/docker-php-ext-install diff --git a/data/docker-php-source b/Dockerfiles/data/docker-php-source similarity index 100% rename from data/docker-php-source rename to Dockerfiles/data/docker-php-source diff --git a/data/php-fpm.conf b/Dockerfiles/data/php-fpm.conf similarity index 100% rename from data/php-fpm.conf rename to Dockerfiles/data/php-fpm.conf diff --git a/data/php.ini b/Dockerfiles/data/php.ini similarity index 100% rename from data/php.ini rename to Dockerfiles/data/php.ini diff --git a/Makefile b/Makefile index eec9857..0345e51 100644 --- a/Makefile +++ b/Makefile @@ -27,13 +27,22 @@ TAG = latest NAME = PHP VERSION = 5.3 IMAGE = devilbox/php-fpm-$(VERSION) -DIR = . -FILE = Dockerfile -DOCKER_TAG = $(TAG) +FLAVOUR = latest +FILE = Dockerfile.$(FLAVOUR) +DIR = Dockerfiles +ifeq ($(strip $(FLAVOUR)),latest) + DOCKER_TAG = $(TAG) +else + ifeq ($(strip $(TAG)),latest) + DOCKER_TAG = $(FLAVOUR) + else + DOCKER_TAG = $(FLAVOUR)-$(TAG) + endif +endif ARCH = linux/amd64 # Makefile.lint overwrites -FL_IGNORES = .git/,.github/,tests/,data/ +FL_IGNORES = .git/,.github/,tests/,Dockerfiles/data/ SC_IGNORES = .git/,.github/,tests/ diff --git a/README.md b/README.md index c2dc65f..bbec292 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,30 @@ This repository will provide you a fully functional PHP-FPM 5.3 Docker image bui |------------|------------------| | | | +## Available Docker tags + +| Docker Tag | Description | +|---------------------------------|--------------------------------------------------------------| +| `latest` | Latest Debian Jessie image (default) | +| `jessie` | Latest Debian Jessie image | +| `stretch` | Latest Debian Stretch image | +| | | +| `[0-9]\.[0-9]+` | Git tagged Debian Jessie image. E.g: `0.53` | +| `jessie-[0-9]\.[0-9]+` | Git tagged Debian Jessie image. E.g: `jessie-0.53` | +| `stretch-[0-9]\.[0-9]+` | Git tagged Debian Stretch image. E.g: `stretch-0.53` | +| | | +| `release-[0-9]\.[0-9]+` | Git branch Debian Jessie image. E.g: `release-0.53` | +| `jessie-release-[0-9]\.[0-9]+` | Git branch Debian Jessie image. E.g: `jessie-release-0.53` | +| `stretch-release-[0-9]\.[0-9]+` | Git branch Debian Stretch image. E.g: `stretch-release-0.53` | + ## Similar Base Images Have a look at the following similar Devilbox base images for which no official versions exist yet: * [PHP-FPM 5.2](https://github.com/devilbox/docker-php-fpm-5.2) * [PHP-FPM 5.3](https://github.com/devilbox/docker-php-fpm-5.3) +* [PHP-FPM 5.4](https://github.com/devilbox/docker-php-fpm-5.4) +* [PHP-FPM 5.5](https://github.com/devilbox/docker-php-fpm-5.5) * [PHP-FPM 7.4](https://github.com/devilbox/docker-php-fpm-7.4) * [PHP-FPM 8.0](https://github.com/devilbox/docker-php-fpm-8.0) * [PHP-FPM 8.1](https://github.com/devilbox/docker-php-fpm-8.1) @@ -115,6 +133,7 @@ modules enabled by default visit: **[devilbox/docker-php-fpm](https://github.com | json | ✔ | | libxml | ✔ | | mysql | ✔ | +| mysqli | ✔ | | mysqlnd | ✔ | | openssl | ✔ | | pcre | ✔ | From ca0cb4b0892c93c343e29dd8b76c3b69cf96c7f7 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sat, 19 Mar 2022 10:37:16 +0100 Subject: [PATCH 2/4] Add custom Dockerfile for Jessie arm64 --- Dockerfiles/Dockerfile.jessie-arm64 | 187 ++++++++++++++++++++++++++++ Makefile | 8 ++ 2 files changed, 195 insertions(+) create mode 100644 Dockerfiles/Dockerfile.jessie-arm64 diff --git a/Dockerfiles/Dockerfile.jessie-arm64 b/Dockerfiles/Dockerfile.jessie-arm64 new file mode 100644 index 0000000..27f0180 --- /dev/null +++ b/Dockerfiles/Dockerfile.jessie-arm64 @@ -0,0 +1,187 @@ +FROM arm64v8/debian:jessie-backports +MAINTAINER "cytopia" + + +ENV PHP_VERSION=5.3.29 +ENV PHP_INI_DIR=/usr/local/etc/php + +ENV OPENSSL_VERSION=1.0.1t + +ENV PHP_BUILD_DEPS \ + autoconf2.13 \ + libbison-dev \ + libcurl4-openssl-dev \ + libfl-dev \ + libmysqlclient-dev \ + libpcre3-dev \ + libreadline6-dev \ + librecode-dev \ + libsqlite3-dev \ + libssl-dev \ + libxml2-dev + +ENV PHP_RUNTIME_DEPS \ + libmysqlclient18 \ + libpcre3 \ + librecode0 \ + libsqlite3-0 \ + libssl1.0.0 \ + libxml2 \ + xz-utils + +ENV BUILD_TOOLS \ + autoconf \ + ca-certificates \ + curl \ + dpkg-dev \ + file \ + flex \ + g++ \ + gcc \ + libc-dev \ + make \ + patch \ + pkg-config \ + re2c \ + xz-utils + +ENV BUILD_TOOLS_32 \ + g++-multilib \ + gcc-multilib + +ENV RUNTIME_TOOLS \ + ca-certificates \ + curl + + +### +### Build OpenSSL +### +RUN set -eux \ +# Install Dependencies + && apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + ${BUILD_TOOLS} \ + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + apt-get install -y --no-install-recommends --no-install-suggests \ + ${BUILD_TOOLS_32}; \ + fi \ +# Fetch OpenSSL + && cd /tmp \ + && mkdir openssl \ + && update-ca-certificates \ + && curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" -o openssl.tar.gz \ + && curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz.asc" -o openssl.tar.gz.asc \ + && tar -xzf openssl.tar.gz -C openssl --strip-components=1 \ + && cd /tmp/openssl \ +# Build OpenSSL + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + setarch i386 ./config -m32; \ + else \ + ./config; \ + fi \ + && make depend \ + && make -j"$(nproc)" \ + && make install \ +# Cleanup + && rm -rf /tmp/* \ +# Ensure libs are linked to correct architecture directory + && debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \ + && mkdir -p "/usr/local/ssl/lib/${debMultiarch}" \ + && ln -s /usr/local/ssl/lib/* "/usr/local/ssl/lib/${debMultiarch}/" \ +# Remove Dependencies + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ + ${BUILD_TOOLS} \ + ${BUILD_TOOLS_32} \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + + +### +### Setup PHP directories +### +RUN set -eux \ + && mkdir -p ${PHP_INI_DIR}/conf.d \ + && mkdir -p /usr/src/php + + +### +### Copy PHP scripts +### +COPY data/docker-php-source /usr/local/bin/ + + +### +### Build PHP +### +RUN set -eux \ +# Install Dependencies + && apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + ${PHP_BUILD_DEPS} \ + ${BUILD_TOOLS} \ + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + apt-get install -y --no-install-recommends --no-install-suggests \ + ${BUILD_TOOLS_32}; \ + fi \ +# Fetch PHP + && curl -sS -k -L --fail "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o /usr/src/php.tar.xz \ + && curl -sS -k -L --fail "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o /usr/src/php.tar.xz.asc \ +# Setup Requirements + && docker-php-source extract \ + && cd /usr/src/php \ + \ + && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ + && debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \ + \ + # https://bugs.php.net/bug.php?id=74125 + && if [ ! -d /usr/include/curl ]; then \ + ln -sT "/usr/include/${debMultiarch}/curl" /usr/local/include/curl; \ + fi \ +# Build PHP + && ./configure \ + --host="${gnuArch}" \ + --with-libdir="/lib/${debMultiarch}/" \ + --with-config-file-path="${PHP_INI_DIR}" \ + --with-config-file-scan-dir="${PHP_INI_DIR}/conf.d" \ + --enable-fpm \ + --with-fpm-user=www-data \ + --with-fpm-group=www-data \ + --disable-cgi \ + --enable-mysqlnd \ + --enable-pdo \ + --with-mysql \ + --with-mysqli \ + --with-curl \ + --with-openssl=/usr/local/ssl \ + --with-readline \ + --with-recode \ + --with-zlib \ + && make -j"$(nproc)" \ + && make install \ +# Cleanup + && make clean \ + && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ + && docker-php-source delete \ +# Remove Dependencies + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ + ${PHP_BUILD_DEPS} \ + ${BUILD_TOOLS} \ + ${BUILD_TOOLS_32} \ +# Install Run-time requirements + && apt-get update \ + && apt-get install -y --no-install-recommends --no-install-suggests \ + ${PHP_RUNTIME_DEPS} \ + ${RUNTIME_TOOLS} \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + + +COPY data/docker-php-* /usr/local/bin/ + +WORKDIR /var/www/html +COPY data/php-fpm.conf /usr/local/etc/ +COPY data/php.ini /usr/local/etc/php/php.ini + +EXPOSE 9000 +CMD ["php-fpm"] diff --git a/Makefile b/Makefile index 0345e51..17e64ad 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,14 @@ else endif endif ARCH = linux/amd64 +ifeq ($(strip $(ARCH)),linux/arm64) + ifeq ($(strip $(FLAVOUR)),latest) + FILE = Dockerfile.jessie-arm64 + endif + ifeq ($(strip $(FLAVOUR)),jessie) + FILE = Dockerfile.jessie-arm64 + endif +endif # Makefile.lint overwrites FL_IGNORES = .git/,.github/,tests/,Dockerfiles/data/ From 672b850e0771296fea41e490ac4855c15b76062f Mon Sep 17 00:00:00 2001 From: cytopia Date: Sat, 19 Mar 2022 10:37:34 +0100 Subject: [PATCH 3/4] Ensure latest is only a symlink --- Dockerfiles/Dockerfile.latest | 188 +--------------------------------- 1 file changed, 1 insertion(+), 187 deletions(-) mode change 100644 => 120000 Dockerfiles/Dockerfile.latest diff --git a/Dockerfiles/Dockerfile.latest b/Dockerfiles/Dockerfile.latest deleted file mode 100644 index b08614c..0000000 --- a/Dockerfiles/Dockerfile.latest +++ /dev/null @@ -1,187 +0,0 @@ -FROM debian:jessie-slim -MAINTAINER "cytopia" - - -ENV PHP_VERSION=5.3.29 -ENV PHP_INI_DIR=/usr/local/etc/php - -ENV OPENSSL_VERSION=1.0.1t - -ENV PHP_BUILD_DEPS \ - autoconf2.13 \ - libbison-dev \ - libcurl4-openssl-dev \ - libfl-dev \ - libmysqlclient-dev \ - libpcre3-dev \ - libreadline6-dev \ - librecode-dev \ - libsqlite3-dev \ - libssl-dev \ - libxml2-dev - -ENV PHP_RUNTIME_DEPS \ - libmysqlclient18 \ - libpcre3 \ - librecode0 \ - libsqlite3-0 \ - libssl1.0.0 \ - libxml2 \ - xz-utils - -ENV BUILD_TOOLS \ - autoconf \ - ca-certificates \ - curl \ - dpkg-dev \ - file \ - flex \ - g++ \ - gcc \ - libc-dev \ - make \ - patch \ - pkg-config \ - re2c \ - xz-utils - -ENV BUILD_TOOLS_32 \ - g++-multilib \ - gcc-multilib - -ENV RUNTIME_TOOLS \ - ca-certificates \ - curl - - -### -### Build OpenSSL -### -RUN set -eux \ -# Install Dependencies - && apt-get update \ - && apt-get install -y --no-install-recommends --no-install-suggests \ - ${BUILD_TOOLS} \ - && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ - apt-get install -y --no-install-recommends --no-install-suggests \ - ${BUILD_TOOLS_32}; \ - fi \ -# Fetch OpenSSL - && cd /tmp \ - && mkdir openssl \ - && update-ca-certificates \ - && curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" -o openssl.tar.gz \ - && curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz.asc" -o openssl.tar.gz.asc \ - && tar -xzf openssl.tar.gz -C openssl --strip-components=1 \ - && cd /tmp/openssl \ -# Build OpenSSL - && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ - setarch i386 ./config -m32; \ - else \ - ./config; \ - fi \ - && make depend \ - && make -j"$(nproc)" \ - && make install \ -# Cleanup - && rm -rf /tmp/* \ -# Ensure libs are linked to correct architecture directory - && debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \ - && mkdir -p "/usr/local/ssl/lib/${debMultiarch}" \ - && ln -s /usr/local/ssl/lib/* "/usr/local/ssl/lib/${debMultiarch}/" \ -# Remove Dependencies - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ - ${BUILD_TOOLS} \ - ${BUILD_TOOLS_32} \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - - -### -### Setup PHP directories -### -RUN set -eux \ - && mkdir -p ${PHP_INI_DIR}/conf.d \ - && mkdir -p /usr/src/php - - -### -### Copy PHP scripts -### -COPY data/docker-php-source /usr/local/bin/ - - -### -### Build PHP -### -RUN set -eux \ -# Install Dependencies - && apt-get update \ - && apt-get install -y --no-install-recommends --no-install-suggests \ - ${PHP_BUILD_DEPS} \ - ${BUILD_TOOLS} \ - && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ - apt-get install -y --no-install-recommends --no-install-suggests \ - ${BUILD_TOOLS_32}; \ - fi \ -# Fetch PHP - && curl -sS -k -L --fail "http://php.net/get/php-$PHP_VERSION.tar.xz/from/this/mirror" -o /usr/src/php.tar.xz \ - && curl -sS -k -L --fail "http://php.net/get/php-$PHP_VERSION.tar.xz.asc/from/this/mirror" -o /usr/src/php.tar.xz.asc \ -# Setup Requirements - && docker-php-source extract \ - && cd /usr/src/php \ - \ - && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ - && debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \ - \ - # https://bugs.php.net/bug.php?id=74125 - && if [ ! -d /usr/include/curl ]; then \ - ln -sT "/usr/include/${debMultiarch}/curl" /usr/local/include/curl; \ - fi \ -# Build PHP - && ./configure \ - --host="${gnuArch}" \ - --with-libdir="/lib/${debMultiarch}/" \ - --with-config-file-path="${PHP_INI_DIR}" \ - --with-config-file-scan-dir="${PHP_INI_DIR}/conf.d" \ - --enable-fpm \ - --with-fpm-user=www-data \ - --with-fpm-group=www-data \ - --disable-cgi \ - --enable-mysqlnd \ - --enable-pdo \ - --with-mysql \ - --with-mysqli \ - --with-curl \ - --with-openssl=/usr/local/ssl \ - --with-readline \ - --with-recode \ - --with-zlib \ - && make -j"$(nproc)" \ - && make install \ -# Cleanup - && make clean \ - && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ - && docker-php-source delete \ -# Remove Dependencies - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ - ${PHP_BUILD_DEPS} \ - ${BUILD_TOOLS} \ - ${BUILD_TOOLS_32} \ -# Install Run-time requirements - && apt-get update \ - && apt-get install -y --no-install-recommends --no-install-suggests \ - ${PHP_RUNTIME_DEPS} \ - ${RUNTIME_TOOLS} \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - - -COPY data/docker-php-* /usr/local/bin/ - -WORKDIR /var/www/html -COPY data/php-fpm.conf /usr/local/etc/ -COPY data/php.ini /usr/local/etc/php/php.ini - -EXPOSE 9000 -CMD ["php-fpm"] diff --git a/Dockerfiles/Dockerfile.latest b/Dockerfiles/Dockerfile.latest new file mode 120000 index 0000000..793e66c --- /dev/null +++ b/Dockerfiles/Dockerfile.latest @@ -0,0 +1 @@ +Dockerfile.jessie \ No newline at end of file From 8865e9717a63ed2d4eebefbe80cf1e32f87b278d Mon Sep 17 00:00:00 2001 From: cytopia Date: Sat, 19 Mar 2022 10:50:28 +0100 Subject: [PATCH 4/4] Fix Jessie source list --- Dockerfiles/Dockerfile.jessie | 10 ++++++-- Dockerfiles/Dockerfile.jessie-arm64 | 38 +++++++++++++++++++++++++++-- Dockerfiles/Dockerfile.stretch | 10 ++++++-- 3 files changed, 52 insertions(+), 6 deletions(-) diff --git a/Dockerfiles/Dockerfile.jessie b/Dockerfiles/Dockerfile.jessie index b08614c..60ca052 100644 --- a/Dockerfiles/Dockerfile.jessie +++ b/Dockerfiles/Dockerfile.jessie @@ -92,7 +92,10 @@ RUN set -eux \ # Remove Dependencies && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ ${BUILD_TOOLS} \ - ${BUILD_TOOLS_32} \ + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ + ${BUILD_TOOLS_32}; \ + fi \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -167,7 +170,10 @@ RUN set -eux \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ ${PHP_BUILD_DEPS} \ ${BUILD_TOOLS} \ - ${BUILD_TOOLS_32} \ + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ + ${BUILD_TOOLS_32}; \ + fi \ # Install Run-time requirements && apt-get update \ && apt-get install -y --no-install-recommends --no-install-suggests \ diff --git a/Dockerfiles/Dockerfile.jessie-arm64 b/Dockerfiles/Dockerfile.jessie-arm64 index 27f0180..64c57da 100644 --- a/Dockerfiles/Dockerfile.jessie-arm64 +++ b/Dockerfiles/Dockerfile.jessie-arm64 @@ -53,6 +53,34 @@ ENV RUNTIME_TOOLS \ ca-certificates \ curl +RUN set -eux \ + && rm -f /etc/apt/sources.list.d/backports.list \ + && { \ + echo "#deb http://deb.debian.org/debian jessie main"; \ + echo "#deb http://security.debian.org/debian-security jessie/updates main"; \ + echo "#deb http://deb.debian.org/debian jessie-updates main"; \ + \ + echo "deb [trusted=yes] http://archive.debian.org/debian jessie main"; \ + echo "deb [trusted=yes] http://archive.debian.org/debian jessie-backports main"; \ + echo "deb [trusted=yes] http://archive.debian.org/debian jessie-backports-sloppy main"; \ + } > /etc/apt/sources.list \ +# Ignore gpg checks + && { \ + echo 'APT { Get { AllowUnauthenticated "1"; }; };'; \ + echo 'APT::Get::AllowUnauthenticated "true";'; \ + } > /etc/apt/apt.conf.d/99allow_unauth \ +# Ignore invalid repositories (EOL) + && { \ + echo 'Acquire::Check-Valid-Until "0";'; \ + } > /etc/apt/apt.conf.d/10no--check-valid-until \ + && apt-key update \ +# Fix: W: GPG error: http://archive.debian.org jessie Release: The following signatures were invalid: KEYEXPIRED 1587841717 + && apt-key list \ + | grep "expired" \ + | awk '{print $2}' \ + | awk -F'/' '{print $2}' \ + | xargs -n1 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys + ### ### Build OpenSSL @@ -92,7 +120,10 @@ RUN set -eux \ # Remove Dependencies && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ ${BUILD_TOOLS} \ - ${BUILD_TOOLS_32} \ + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ + ${BUILD_TOOLS_32}; \ + fi \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -167,7 +198,10 @@ RUN set -eux \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ ${PHP_BUILD_DEPS} \ ${BUILD_TOOLS} \ - ${BUILD_TOOLS_32} \ + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ + ${BUILD_TOOLS_32}; \ + fi \ # Install Run-time requirements && apt-get update \ && apt-get install -y --no-install-recommends --no-install-suggests \ diff --git a/Dockerfiles/Dockerfile.stretch b/Dockerfiles/Dockerfile.stretch index 7a2ddab..5607570 100644 --- a/Dockerfiles/Dockerfile.stretch +++ b/Dockerfiles/Dockerfile.stretch @@ -92,7 +92,10 @@ RUN set -eux \ # Remove Dependencies && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ ${BUILD_TOOLS} \ - ${BUILD_TOOLS_32} \ + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ + ${BUILD_TOOLS_32}; \ + fi \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -170,7 +173,10 @@ RUN set -eux \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ ${PHP_BUILD_DEPS} \ ${BUILD_TOOLS} \ - ${BUILD_TOOLS_32} \ + && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \ + ${BUILD_TOOLS_32}; \ + fi \ # Install Run-time requirements && apt-get update \ && apt-get install -y --no-install-recommends --no-install-suggests \