diff --git a/.dive-ci.yml b/.dive-ci.yml new file mode 100644 index 0000000..f81d725 --- /dev/null +++ b/.dive-ci.yml @@ -0,0 +1,13 @@ +rules: + # If the efficiency is measured below X%, mark as failed. + # Expressed as a ratio between 0-1. + lowestEfficiency: 0.90 + + # If the amount of wasted space is at least X or larger than X, mark as failed. + # Expressed in B, KB, MB, and GB. + highestWastedBytes: 128MB + + # If the amount of wasted space makes up for X% or more of the image, mark as failed. + # Note: the base image layer is NOT included in the total image size. + # Expressed as a ratio between 0-1; fails if the threshold is met or crossed. + highestUserWastedPercent: 0.10 diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml deleted file mode 100644 index fa33657..0000000 --- a/.github/workflows/build-and-push.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Build and Push to DockerHub - -on: - release: - types: [published] - -env: - REGISTRY: docker.io - IMAGE_NAME: appwrite/utopia-base - TAG: ${{ github.event.release.tag_name }} - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - php-versions: ['8.2', '8.3', '8.4', '8.5'] # add PHP versions as required - steps: - - name: Checkout the repo - uses: actions/checkout@v3 - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ vars.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: php-${{ matrix.php-versions }}/. - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:php-${{ matrix.php-versions }}-${{ env.TAG }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f127da4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,184 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + schedule: + - cron: '43 11 * * 6' + +concurrency: + # PR runs cancel earlier runs on the same ref. Push/schedule runs share + # the per-commit group used by release.yml so a release queues behind + # CI on the same commit instead of racing. + group: ${{ github.event_name == 'pull_request' && format('ci-pr-{0}', github.ref) || format('build-{0}', github.sha) }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +permissions: + contents: read + security-events: write + actions: read + +env: + REGISTRY: docker.io + IMAGE_NAME: appwrite/utopia-base + +jobs: + build: + name: Build (${{ matrix.php-versions }}, ${{ matrix.arch }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + php-versions: ['8.3', '8.4', '8.5'] + arch: [amd64, arm64] + include: + - arch: amd64 + os: ubuntu-24.04 + - arch: arm64 + os: ubuntu-24.04-arm + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Build image + run: | + docker image build --tag utopia-base-test php-${{ matrix.php-versions }}/. + + - name: Save image + run: docker image save utopia-base-test -o image.tar + + - name: Upload image artifact + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: image-php-${{ matrix.php-versions }}-${{ matrix.arch }} + path: image.tar + retention-days: 1 + + structure-test: + name: Structure (${{ matrix.php-versions }}, ${{ matrix.arch }}) + needs: build + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + php-versions: ['8.3', '8.4', '8.5'] + arch: [amd64, arm64] + include: + - arch: amd64 + os: ubuntu-24.04 + - arch: arm64 + os: ubuntu-24.04-arm + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Download image artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: image-php-${{ matrix.php-versions }}-${{ matrix.arch }} + + - name: Load image + run: docker image load -i image.tar + + - name: Install container-structure-test + env: + CST_VERSION: v1.22.1 + run: | + base="https://github.com/GoogleContainerTools/container-structure-test/releases/download/${CST_VERSION}" + asset="container-structure-test-linux-${{ matrix.arch }}" + curl -fsSL -o "$asset" "$base/$asset" + curl -fsSL -o checksums.txt "$base/checksums.txt" + grep " $asset\$" checksums.txt | sha256sum -c - + chmod +x "$asset" + sudo mv "$asset" /usr/local/bin/container-structure-test + + - name: Run container structure tests + run: container-structure-test test --image utopia-base-test --config php-${{ matrix.php-versions }}/tests.yaml + + dive: + name: Dive (${{ matrix.php-versions }}) + needs: build + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + php-versions: ['8.3', '8.4', '8.5'] + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Download image artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: image-php-${{ matrix.php-versions }}-amd64 + + - name: Load image + run: docker image load -i image.tar + + - name: Install dive + env: + DIVE_VERSION: v0.13.1 + run: | + ver="${DIVE_VERSION#v}" + base="https://github.com/wagoodman/dive/releases/download/${DIVE_VERSION}" + asset="dive_${ver}_linux_amd64.tar.gz" + curl -fsSL -o "$asset" "$base/$asset" + curl -fsSL -o checksums.txt "$base/dive_${ver}_checksums.txt" + grep " $asset\$" checksums.txt | sha256sum -c - + tar -xzf "$asset" dive + chmod +x dive + sudo mv dive /usr/local/bin/dive + + - name: Run dive + id: dive + run: | + set -o pipefail + CI=true dive --ci-config .dive-ci.yml utopia-base-test | tee dive.log + + - name: Publish dive report to step summary + if: always() && steps.dive.outcome != 'skipped' + run: | + { + echo "## Dive — php-${{ matrix.php-versions }}" + echo + echo '```' + cat dive.log + echo '```' + } >> "$GITHUB_STEP_SUMMARY" + + trivy: + name: Trivy (${{ matrix.php-versions }}) + needs: build + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + php-versions: ['8.3', '8.4', '8.5'] + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Download image artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: image-php-${{ matrix.php-versions }}-amd64 + + - name: Load image + run: docker image load -i image.tar + + - name: Run Trivy + uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # 0.35.0 + with: + format: 'sarif' + image-ref: 'utopia-base-test' + output: 'trivy-results-php-${{ matrix.php-versions }}.sarif' + severity: 'CRITICAL,HIGH' + + - name: Upload SARIF + uses: github/codeql-action/upload-sarif@96a56f9e1619f4ee5970aabb968dc392d1e9b425 # codeql-bundle-v2.25.4 + with: + sarif_file: 'trivy-results-php-${{ matrix.php-versions }}.sarif' + category: 'php-${{ matrix.php-versions }}' + diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml new file mode 100644 index 0000000..847f62d --- /dev/null +++ b/.github/workflows/cleanup.yml @@ -0,0 +1,56 @@ +name: Cleanup + +on: + schedule: + - cron: '0 5 * * *' + workflow_dispatch: + +permissions: + contents: read + +env: + REGISTRY: docker.io + REPO: appwrite/utopia-base + # Delete CI tags (those matching php-X.Y-[-arch]) last pushed more + # than this many days ago. Released semver tags don't match the regex + # and are never touched. + TTL_DAYS: 14 + +jobs: + prune: + name: Prune + runs-on: ubuntu-24.04 + steps: + - name: Prune stale tags + env: + DOCKERHUB_USERNAME: ${{ vars.DOCKERHUB_USERNAME }} + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + run: | + set -euo pipefail + + token=$(curl -fsS -H "Content-Type: application/json" \ + -X POST \ + -d "{\"username\": \"$DOCKERHUB_USERNAME\", \"password\": \"$DOCKERHUB_PASSWORD\"}" \ + https://hub.docker.com/v2/users/login/ | jq -r .token) + + cutoff=$(date -u -d "${TTL_DAYS} days ago" +%s) + # CI tags look like php-8.3-<40-char sha>[-amd64|-arm64] + pattern='^php-[0-9]+\.[0-9]+-[0-9a-f]{40}(-(amd64|arm64))?$' + + url="https://hub.docker.com/v2/repositories/${REPO}/tags?page_size=100" + while [ -n "$url" ] && [ "$url" != "null" ]; do + page=$(curl -fsS -H "Authorization: JWT $token" "$url") + url=$(echo "$page" | jq -r '.next') + + while IFS=$'\t' read -r name pushed; do + [[ "$name" =~ $pattern ]] || continue + pushed_ts=$(date -u -d "$pushed" +%s) + if [ "$pushed_ts" -lt "$cutoff" ]; then + echo "Deleting $name (pushed $pushed)" + curl -fsS -X DELETE \ + -H "Authorization: JWT $token" \ + "https://hub.docker.com/v2/repositories/${REPO}/tags/${name}/" + fi + done < <(echo "$page" | jq -r '.results[] | "\(.name)\t\(.tag_last_pushed)"') + done + echo "Done." diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..67f9db3 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,91 @@ +name: Publish + +on: + workflow_run: + workflows: [CI] + types: [completed] + branches: [main] + +concurrency: + group: build-${{ github.event.workflow_run.head_sha }} + cancel-in-progress: false + +permissions: + contents: read + actions: read + +env: + REGISTRY: docker.io + IMAGE_NAME: appwrite/utopia-base + +jobs: + push: + name: Push (${{ matrix.php-versions }}, ${{ matrix.arch }}) + if: github.event.workflow_run.conclusion == 'success' + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + php-versions: ['8.3', '8.4', '8.5'] + arch: [amd64, arm64] + steps: + - name: Login to Docker Hub + uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Download image artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: image-php-${{ matrix.php-versions }}-${{ matrix.arch }} + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ github.token }} + + - name: Load image + run: docker image load -i image.tar + + - name: Docker meta + id: meta + uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + flavor: | + latest=false + suffix=-${{ matrix.arch }} + tags: | + type=raw,value=php-${{ matrix.php-versions }}-${{ github.event.workflow_run.head_sha }} + + - name: Push image + run: | + for tag in ${{ steps.meta.outputs.tags }}; do + docker tag utopia-base-test "$tag" + docker push "$tag" + done + + manifest: + name: Manifest (${{ matrix.php-versions }}) + needs: push + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + php-versions: ['8.3', '8.4', '8.5'] + steps: + - name: Login to Docker Hub + uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 + + - name: Create manifest + env: + SHA: ${{ github.event.workflow_run.head_sha }} + run: | + docker buildx imagetools create \ + -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:php-${{ matrix.php-versions }}-${SHA} \ + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:php-${{ matrix.php-versions }}-${SHA}-amd64 \ + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:php-${{ matrix.php-versions }}-${SHA}-arm64 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..106f436 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,55 @@ +name: Release + +on: + release: + types: [published] + +# Share the per-commit build group with ci.yml. If CI is still running +# on this commit, release queues behind it. +concurrency: + group: build-${{ github.sha }} + cancel-in-progress: false + +permissions: + contents: read + +env: + REGISTRY: docker.io + IMAGE_NAME: appwrite/utopia-base + +# Promote the already-built, already-tested CI image (built on the +# release's target commit) to the release tag — no rebuild. +jobs: + promote: + name: Promote (${{ matrix.php-versions }}) + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + php-versions: ['8.3', '8.4', '8.5'] + steps: + - name: Login to Docker Hub + uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 + + - name: Docker meta + id: meta + uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + flavor: | + latest=false + tags: | + type=raw,value=php-${{ matrix.php-versions }}-${{ github.event.release.tag_name }} + + - name: Promote + run: | + SRC=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:php-${{ matrix.php-versions }}-${{ github.sha }} + for tag in ${{ steps.meta.outputs.tags }}; do + docker buildx imagetools create -t "$tag" "$SRC" + done diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 7ce4384..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Test container structure - -on: - pull_request: - branches: - - main - -env: - REGISTRY: docker.io - IMAGE_NAME: appwrite/base - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - php-versions: ['8.2', '8.3', '8.4', '8.5'] # add PHP versions as required - steps: - - name: Checkout the repo - uses: actions/checkout@v3 - - - name: Setup container structure test - run: | - curl -LO https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-amd64 - chmod +x container-structure-test-linux-amd64 - sudo mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test - - - name: Build & run container structure test - run: | - docker build -t utopia-base-test php-${{ matrix.php-versions }}/. - container-structure-test test --image utopia-base-test --config tests.yaml php-${{ matrix.php-versions }}/tests.yaml diff --git a/README.md b/README.md index 327b0e1..9c85a87 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,40 @@ # docker-base -Base docker image for Utopia libraries + +Multi-arch base Docker images for Utopia PHP libraries, built on Alpine with Swoole and a curated set of PHP extensions. + +## Supported PHP versions + +- PHP 8.3 +- PHP 8.4 +- PHP 8.5 + +Each version is published as a multi-arch image (`linux/amd64`, `linux/arm64`). + +## Tags + +Images are published to [`appwrite/utopia-base`](https://hub.docker.com/r/appwrite/utopia-base) on Docker Hub. + +| Tag | Source | Stability | +| --- | --- | --- | +| `php--` | `release.yml` on a published GitHub release | Stable — pin to this in production | +| `php--` | `publish.yml` on every push to `main` after CI passes | Tracks `main` — useful for testing, garbage-collected after 14 days | + +`` is one of `8.3`, `8.4`, `8.5`. `` is the GitHub release tag (e.g. `0.5.0`). `` is the full 40-char commit SHA. + +## CI/CD + +Four workflows: + +- **`ci.yml`** — runs on PRs, pushes to `main`, and weekly. Builds each `(php × arch)` once, shares the image via artifact, then runs structure tests, [dive](https://github.com/wagoodman/dive) efficiency checks, and [Trivy](https://github.com/aquasecurity/trivy) CVE scans against the artifact. SARIF results upload to the Security tab. +- **`publish.yml`** — `workflow_run`-triggered after CI succeeds on `main`. Pushes per-arch tags and assembles the multi-arch manifest under `php--`. No rebuild — uses CI's artifacts. +- **`release.yml`** — triggered by `release: published`. Promotes the existing `php--` manifest to `php--` via `docker buildx imagetools create`. No rebuild. +- **`cleanup.yml`** — daily cron. Deletes `php--[-arch]` tags older than 14 days from Docker Hub. Release tags don't match the regex and are never touched. + +All publishing workflows share a `build-` concurrency group so a release queues behind in-flight CI on the same commit. + +## Local development + +```sh +docker build -t utopia-base-test php-8.4/. +container-structure-test test --image utopia-base-test --config php-8.4/tests.yaml +``` diff --git a/php-8.2/Dockerfile b/php-8.2/Dockerfile deleted file mode 100644 index ea02f69..0000000 --- a/php-8.2/Dockerfile +++ /dev/null @@ -1,209 +0,0 @@ -FROM php:8.2-cli-alpine AS compile - -ENV PHP_REDIS_VERSION="6.1.0" \ - PHP_SWOOLE_VERSION="v6.2.0" \ - PHP_IMAGICK_VERSION="3.7.0" \ - PHP_YAML_VERSION="2.2.4" \ - PHP_MAXMINDDB_VERSION="v1.12.0" \ - PHP_SCRYPT_VERSION="2.0.1" \ - PHP_ZSTD_VERSION="0.14.0" \ - PHP_BROTLI_VERSION="0.15.0" \ - PHP_SNAPPY_VERSION="0.2.2" \ - PHP_LZ4_VERSION="0.4.4" \ - PHP_XDEBUG_VERSION="3.4.1" \ - PHP_MONGO_VERSION="2.2.1" - -RUN \ - apk add --no-cache --virtual .deps \ - linux-headers \ - icu-dev \ - make \ - automake \ - autoconf \ - gcc \ - g++ \ - git \ - zlib-dev \ - openssl-dev \ - yaml-dev \ - imagemagick \ - imagemagick-dev \ - libjpeg-turbo-dev \ - jpeg-dev \ - libjxl-dev \ - libmaxminddb-dev \ - zstd-dev \ - brotli-dev \ - lz4-dev \ - curl-dev \ - cmake - -RUN docker-php-ext-install sockets - -FROM compile AS redis -RUN \ - # Redis Extension - git clone --depth 1 --branch $PHP_REDIS_VERSION https://github.com/phpredis/phpredis.git && \ - cd phpredis && \ - phpize && \ - ./configure && \ - make && make install - -## Swoole Extension -FROM compile AS swoole -RUN \ - git clone --depth 1 --branch $PHP_SWOOLE_VERSION https://github.com/swoole/swoole-src.git && \ - cd swoole-src && \ - phpize && \ - ./configure --enable-sockets --enable-http2 --enable-openssl --enable-swoole-curl && \ - make && make install && \ - cd .. - -## Imagick Extension -FROM compile AS imagick -RUN \ - git clone --depth 1 --branch $PHP_IMAGICK_VERSION https://github.com/imagick/imagick && \ - cd imagick && \ - phpize && \ - ./configure && \ - make && make install - -## YAML Extension -FROM compile AS yaml -RUN \ - git clone --depth 1 --branch $PHP_YAML_VERSION https://github.com/php/pecl-file_formats-yaml && \ - cd pecl-file_formats-yaml && \ - phpize && \ - ./configure && \ - make && make install - -## Maxminddb extension -FROM compile AS maxmind -RUN \ - git clone --depth 1 --branch $PHP_MAXMINDDB_VERSION https://github.com/maxmind/MaxMind-DB-Reader-php.git && \ - cd MaxMind-DB-Reader-php && \ - cd ext && \ - phpize && \ - ./configure && \ - make && make install - -# Zstd Compression -FROM compile AS zstd -RUN git clone --recursive -n https://github.com/kjdev/php-ext-zstd.git \ - && cd php-ext-zstd \ - && git checkout $PHP_ZSTD_VERSION \ - && phpize \ - && ./configure --with-libzstd \ - && make && make install - -## Brotli Extension -FROM compile AS brotli -RUN git clone https://github.com/kjdev/php-ext-brotli.git \ - && cd php-ext-brotli \ - && git reset --hard $PHP_BROTLI_VERSION \ - && phpize \ - && ./configure --with-libbrotli \ - && make && make install - -## LZ4 Extension -FROM compile AS lz4 -RUN git clone --recursive https://github.com/kjdev/php-ext-lz4.git \ - && cd php-ext-lz4 \ - && git reset --hard $PHP_LZ4_VERSION \ - && phpize \ - && ./configure --with-lz4-includedir=/usr \ - && make && make install - -## Snappy Extension -FROM compile AS snappy -RUN git clone --recursive https://github.com/kjdev/php-ext-snappy.git \ - && cd php-ext-snappy \ - && git reset --hard $PHP_SNAPPY_VERSION \ - && phpize \ - && ./configure \ - && make && make install - -## Scrypt Extension -FROM compile AS scrypt -RUN git clone --depth 1 https://github.com/DomBlack/php-scrypt.git \ - && cd php-scrypt \ - && git reset --hard $PHP_SCRYPT_VERSION \ - && phpize \ - && ./configure --enable-scrypt \ - && make && make install - -## XDebug Extension -FROM compile AS xdebug -RUN \ - git clone --depth 1 --branch $PHP_XDEBUG_VERSION https://github.com/xdebug/xdebug && \ - cd xdebug && \ - phpize && \ - ./configure && \ - make && make install - -## MongoDB Extension -FROM compile AS mongodb -RUN \ - git clone --depth 1 --recursive --branch $PHP_MONGO_VERSION https://github.com/mongodb/mongo-php-driver.git && \ - cd mongo-php-driver && \ - phpize && \ - ./configure && \ - make && make install - -FROM php:8.2-cli-alpine AS final - -LABEL maintainer="team@appwrite.io" - -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN \ - apk update \ - && apk add --no-cache \ - linux-headers \ - rsync \ - brotli-dev \ - lz4-dev \ - zstd-dev \ - yaml-dev \ - imagemagick \ - libjpeg-turbo \ - libjxl \ - libavif \ - libheif \ - imagemagick-heic \ - libgomp \ - libwebp \ - git \ - && rm -rf /var/cache/apk/* - -RUN docker-php-ext-install sockets - -WORKDIR /usr/src/code - -COPY --from=swoole /usr/local/lib/php/extensions/no-debug-non-zts-20220829/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/ -COPY --from=redis /usr/local/lib/php/extensions/no-debug-non-zts-20220829/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/ -COPY --from=imagick /usr/local/lib/php/extensions/no-debug-non-zts-20220829/imagick.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/ -COPY --from=yaml /usr/local/lib/php/extensions/no-debug-non-zts-20220829/yaml.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/ -COPY --from=scrypt /usr/local/lib/php/extensions/no-debug-non-zts-20220829/scrypt.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/ -COPY --from=zstd /usr/local/lib/php/extensions/no-debug-non-zts-20220829/zstd.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/ -COPY --from=brotli /usr/local/lib/php/extensions/no-debug-non-zts-20220829/brotli.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/ -COPY --from=lz4 /usr/local/lib/php/extensions/no-debug-non-zts-20220829/lz4.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/ -COPY --from=snappy /usr/local/lib/php/extensions/no-debug-non-zts-20220829/snappy.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/ -COPY --from=xdebug /usr/local/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/ -COPY --from=mongodb /usr/local/lib/php/extensions/no-debug-non-zts-20220829/mongodb.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/ - -# Enable Extensions -RUN echo extension=swoole.so >> /usr/local/etc/php/conf.d/swoole.ini -RUN echo extension=redis.so >> /usr/local/etc/php/conf.d/redis.ini -RUN echo extension=imagick.so >> /usr/local/etc/php/conf.d/imagick.ini -RUN echo extension=yaml.so >> /usr/local/etc/php/conf.d/yaml.ini -RUN echo extension=scrypt.so >> /usr/local/etc/php/conf.d/scrypt.ini -RUN echo extension=zstd.so >> /usr/local/etc/php/conf.d/zstd.ini -RUN echo extension=brotli.so >> /usr/local/etc/php/conf.d/brotli.ini -RUN echo extension=lz4.so >> /usr/local/etc/php/conf.d/lz4.ini -RUN echo extension=snappy.so >> /usr/local/etc/php/conf.d/snappy.ini -RUN echo extension=mongodb.so >> /usr/local/etc/php/conf.d/mongodb.ini - -EXPOSE 80 - -CMD [ "tail", "-f", "/dev/null" ] diff --git a/php-8.2/tests.yaml b/php-8.2/tests.yaml deleted file mode 100644 index 9b1f136..0000000 --- a/php-8.2/tests.yaml +++ /dev/null @@ -1,34 +0,0 @@ -schemaVersion: '2.0.0' - -fileExistenceTests: - ## Extension files - - name: 'Check swoole extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/swoole.so - shouldExist: true - - name: 'Check redis extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/redis.so - shouldExist: true - - name: 'Check imagick extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/imagick.so - shouldExist: true - - name: 'Check yaml extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/yaml.so - shouldExist: true - - name: 'Check scrypt extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/scrypt.so - shouldExist: true - - name: 'Check zstd extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/zstd.so - shouldExist: true - - name: 'Check brotli extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/brotli.so - shouldExist: true - - name: 'Check lz4 extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/lz4.so - shouldExist: true - - name: 'Check snappy extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/snappy.so - shouldExist: true - - name: 'Check mongodb extension' - path: /usr/local/lib/php/extensions/no-debug-non-zts-20220829/mongodb.so - shouldExist: true \ No newline at end of file