diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml new file mode 100644 index 0000000..bf6a8ea --- /dev/null +++ b/.github/workflows/test-builds.yml @@ -0,0 +1,67 @@ +name: docker-build + +on: + workflow_dispatch: + pull_request: + branches: + - develop + +env: + OLS_VERSION: 1.7.17 + PHP_STABLE_VERSION: '8.2.8' + REGISTRY: ghcr.io + +jobs: + buildx: + runs-on: self-hosted + strategy: + fail-fast: false + matrix: + PHP_VERSION: ['8.0.29', '8.1.21', '8.2.8'] + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags + + # https://github.com/marketplace/actions/docker-setup-buildx + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + # https://github.com/marketplace/actions/docker-login + - name: Login to GitHub Packages + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + logout: false + + # https://github.com/orgs/community/discussions/26625#discussioncomment-3252582 + - name: Determine PHP Major/Minor Version + id: php-version + run: | + _0=$(echo ${{ matrix.PHP_VERSION }} | cut -d. -f1) + _1=$(echo ${{ matrix.PHP_VERSION }} | cut -d. -f2) + echo "_0=$_0" >> $GITHUB_OUTPUT + echo "_1=$_1" >> $GITHUB_OUTPUT + + # https://github.com/marketplace/actions/build-and-push-docker-images + - name: Build Docker Images + uses: docker/build-push-action@v4 + with: + context: template + platforms: linux/arm64 + provenance: false + build-args: | + OLS_VERSION=${{ env.OLS_VERSION }} + PHP_VERSION=${{ matrix.PHP_VERSION }} + PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }} + PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }} + push: false + tags: ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }} + no-cache: ${{ github.event_name == 'workflow_dispatch' && true || false }} + cache-from: type=registry,ref=${{ env.REGISTRY }}/ndigitals/openlitespeed:latest + cache-to: type=inline + diff --git a/template/Dockerfile b/template/Dockerfile index d72c19f..dbd8a1d 100644 --- a/template/Dockerfile +++ b/template/Dockerfile @@ -12,7 +12,7 @@ ARG PHP_MINOR_VERSION FROM litespeedtech/openlitespeed:${OLS_VERSION}-lsphp${PHP_MAJOR_VERSION}0 AS ols -FROM debian:11-slim +FROM debian:12-slim LABEL org.opencontainers.image.url=https://github.com/ndigitals/ols-dockerfiles LABEL org.opencontainers.image.documentation=https://github.com/ndigitals/ols-dockerfiles/wiki diff --git a/template/config-build-env.sh b/template/config-build-env.sh index 68f0a71..b72e203 100755 --- a/template/config-build-env.sh +++ b/template/config-build-env.sh @@ -12,7 +12,7 @@ MINIMAL_APT_GET_ARGS='-y --no-install-recommends' PACKAGES_INSTALLED_LOG="/tmp/packages.lst" ## Run time dependencies ## -RUN_PACKAGES="ca-certificates cron tzdata openssl mariadb-client libgssapi-krb5-2 libkrb5-3 libexpat1 libxml2 libargon2-1 libenchant-2-2 libpng16-16 libwebp6 libjpeg62-turbo libxpm4 libfreetype6 libonig5 libsodium23 libxslt1.1 libzip4 libzstd1 liblz4-1 libcurl4 imagemagick libc-client2007e libmemcached11 libdbd-freetds freetds-bin procps libatomic1 net-tools less libjpeg-turbo-progs optipng gifsicle zip unzip libyajl2 libpcre2-posix2 libpcre++0v5 liblmdb0 libgeoip1 ruby-full gnupg2 nodejs yarn" +RUN_PACKAGES="ca-certificates cron tzdata openssl libssl3 mariadb-client libgssapi-krb5-2 libkrb5-3 libexpat1 libxml2 libargon2-1 libenchant-2-2 libpng16-16 libwebp7 libjpeg62-turbo libxpm4 libfreetype6 libonig5 libsodium23 libxslt1.1 libzip4 libzstd1 liblz4-1 libcurl4 libcurlpp0 imagemagick libc-client2007e libmemcached11 libdbd-freetds freetds-bin procps libatomic1 net-tools less libjpeg-turbo-progs optipng gifsicle zip unzip libyajl2 libpcre2-posix3 liblmdb0 libgeoip1 ruby-full gnupg2 nodejs yarn" ## Build time dependencies ## @@ -24,10 +24,10 @@ BUILD_PACKAGES="git curl wget" BUILD_PACKAGES="$BUILD_PACKAGES pkg-config" # OLS build required packages -BUILD_PACKAGES="$BUILD_PACKAGES cmake g++ libgeoip-dev liblmdb-dev libyajl-dev libpcre++-dev" +BUILD_PACKAGES="$BUILD_PACKAGES cmake g++ libgeoip-dev liblmdb-dev libyajl-dev" # PHP building required packages -BUILD_PACKAGES="$BUILD_PACKAGES build-essential libssl-dev libdb5.3-dev krb5-multidev libkrb5-dev bison autoconf automake libtool re2c flex libxml2-dev libbz2-dev libcurl4-openssl-dev libexpat1-dev libjpeg-dev libfreetype6-dev libgmp3-dev libpng-dev libxpm-dev libc-client2007e-dev libenchant-2-dev libsasl2-dev libc-client2007e-dev libldap2-dev libldb-dev libmcrypt-dev libmhash-dev freetds-dev zlib1g-dev libpq-dev libmariadb-dev-compat libmariadb-dev libncurses5-dev libpcre2-dev libpcre3-dev unixodbc-dev libsqlite3-dev libaspell-dev libreadline6-dev librecode-dev libsnmp-dev libtidy-dev libxslt-dev libonig-dev libzip-dev libwebp-dev freetds-dev libpspell-dev libedit-dev libsodium-dev libargon2-dev libvarnishapi-dev libmagickwand-dev libmagickcore-dev libmemcached-dev libzstd-dev liblz4-dev libyaml-dev libffi-dev" +BUILD_PACKAGES="$BUILD_PACKAGES build-essential libssl-dev libdb5.3-dev krb5-multidev libkrb5-dev bison autoconf automake libtool re2c flex libxml2-dev libbz2-dev libcurlpp-dev libcurl4-openssl-dev libexpat1-dev libjpeg-dev libfreetype6-dev libgmp3-dev libpng-dev libxpm-dev libc-client2007e-dev libenchant-2-dev libsasl2-dev libc-client2007e-dev libldap2-dev libldb-dev libmcrypt-dev libmhash-dev freetds-dev zlib1g-dev libpq-dev libmariadb-dev-compat libmariadb-dev libncurses5-dev libpcre2-dev unixodbc-dev libsqlite3-dev libaspell-dev libreadline6-dev librecode-dev libsnmp-dev libtidy-dev libxslt-dev libonig-dev libzip-dev libwebp-dev freetds-dev libpspell-dev libedit-dev libsodium-dev libargon2-dev libvarnishapi-dev libmagickwand-dev libmagickcore-dev libmemcached-dev libzstd-dev liblz4-dev libyaml-dev libffi-dev" # apt-get remove --allow-remove-essential enters an infinite loop of # pam errors with this package