-
Notifications
You must be signed in to change notification settings - Fork 9
Updated PHP, Swoole, Imagemagick, Add more CI scanning, ... #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
1024731
ADD pr-scan.yml pipeline, UPDATE PHP to 8.5.3. UPDATE .gitignore, REA…
davidjeddy 418bfe0
FIX Trivy scanning step name
davidjeddy d6fe48d
REVERT PHP to 8.4.18 due to build failure
davidjeddy 955d067
UPDATED aquasecurity/trivy-action to 0.35.0
davidjeddy e7c0e31
Version bumped PHP/Swoole in container image
davidjeddy fa5df86
CI trigger
davidjeddy eb89709
Running pr-scan CI on any push. Every commit should be built, even if…
davidjeddy a2e5fd8
T/Sing build issue of not finding zstd so
davidjeddy 1a804b0
Updated pipeline action versions
davidjeddy 5b993d0
Build passing tests now
davidjeddy bb9281b
ADD image push for feature branch builds
davidjeddy 258e983
Remove docker-buildx for now, we do not use ARM hosts
davidjeddy adc52e8
REMOVE multi-arch builds in exchange for faster build and releases
davidjeddy b0bc807
Refactory ARM build process to avoid cross-arch building
davidjeddy e5134a2
Trying to fix multi-arch builds
davidjeddy 7141e77
ADD dive test tool. ADD image lifecycle GH action. Dockerfile now bas…
davidjeddy 9ff192d
Working on getting Trivy report into Security Tab
davidjeddy 11abdac
FIX scheduled trivy GH action
davidjeddy 36c11ed
FIX spelling
davidjeddy 434dbb2
Changes from feedback
davidjeddy b7bc9f0
Feedback improvements
davidjeddy 60392ba
Feedback corrections
davidjeddy 2693847
Feedback corrections
davidjeddy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| .git* | ||
| *.md | ||
| *test*.* | ||
| Dockerfile | ||
| LICENSE | ||
| trivy-*.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,87 @@ | ||
| name: Build and Push to DockerHub | ||
| name: Build and Push | ||
|
|
||
| on: | ||
| on: | ||
| push: | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| REGISTRY: docker.io | ||
| IMAGE_NAME: appwrite/base | ||
| TAG: ${{ github.event.release.tag_name }} | ||
| REGISTRY: docker.io | ||
|
|
||
| # https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/ | ||
| # https://learn.arm.com/learning-paths/cross-platform/github-arm-runners/actions/ | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| build_and_push: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-24.04 | ||
| arch: amd64 | ||
| - os: ubuntu-24.04-arm | ||
| arch: arm64 | ||
| steps: | ||
| - name: Checkout the repo | ||
| uses: actions/checkout@v3 | ||
| uses: actions/checkout@v6.0.2 | ||
|
|
||
| - name: Login to DockerHub | ||
| uses: docker/login-action@v2 | ||
| uses: docker/login-action@v4 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v2 | ||
| - name: Build an image from Dockerfile | ||
| run: | | ||
| docker image build --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-${{matrix.arch}} . | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v2 | ||
| - name: Push an image | ||
| run: | | ||
| docker image push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-${{matrix.arch}} | ||
|
|
||
| - name: Build and push | ||
| uses: docker/build-push-action@v4 | ||
| manifest_build_and_push_on_feature: | ||
| if: github.ref != 'refs/heads/main' | ||
| needs: build_and_push | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Login to DockerHub | ||
| uses: docker/login-action@v4 | ||
| with: | ||
| context: . | ||
| platforms: linux/amd64,linux/arm64 | ||
| push: true | ||
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG }} | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Create manifest | ||
| run: | | ||
| docker manifest create \ | ||
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \ | ||
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64 \ | ||
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64 | ||
|
|
||
| - name: Push manifest | ||
| run: | | ||
| docker manifest push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} | ||
|
|
||
| manifest_build_and_push_on_main: | ||
| if: github.ref == 'refs/heads/main' | ||
| needs: build_and_push | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Login to DockerHub | ||
| uses: docker/login-action@v4 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Create manifest | ||
| run: | | ||
| docker manifest create \ | ||
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }} \ | ||
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64 \ | ||
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64 | ||
|
|
||
| - name: Push manifest | ||
| run: | | ||
| docker manifest push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }} | ||
davidjeddy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| name: Dive Test | ||
|
|
||
| on: push | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| IMAGE_NAME: appwrite/base | ||
| REGISTRY: docker.io | ||
|
|
||
| jobs: | ||
| dive: | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6.0.2 | ||
|
|
||
| - name: Build an image from Dockerfile | ||
| run: | | ||
| docker image build --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} . | ||
|
|
||
| - name: Dive | ||
| uses: yuichielectric/dive-action@0.0.4 | ||
| with: | ||
| config-file: ${{ github.workspace }}/.dive-ci.yml | ||
| image: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}' | ||
davidjeddy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # https://github.com/marketplace/actions/container-structure-test-action | ||
| name: Container Structure Test | ||
|
|
||
| on: push | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| IMAGE_NAME: appwrite/base | ||
| REGISTRY: docker.io | ||
|
|
||
| jobs: | ||
| structure_test: | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Checkout the repo | ||
| uses: actions/checkout@v6.0.2 | ||
|
|
||
| - name: Build an image from Dockerfile | ||
| run: | | ||
| docker image build --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} . | ||
|
|
||
| - name: Run container structure tests | ||
| uses: plexsystems/container-structure-test-action@v0.1.0 | ||
| with: | ||
| image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} | ||
| config: tests.yaml |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
davidjeddy marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # CHANGELOG | ||
|
|
||
| ## Version 1.1.0 | ||
|
|
||
| ### Add | ||
|
|
||
| * .dockerignore | ||
| * .github/workflows/pr-scan.yml to scan all commit pushes for vulnerabilities | ||
| * base_image and php_build_date to container labels | ||
| * container image build action to publish image using commit sha | ||
| * container-structure-test to check PHP version (currently set to 8.5.3) | ||
| * container-structure-test to check swoole version (currently set to 6.2.0) | ||
| * SECURITY.md to align with appwrite/appwrite | ||
|
|
||
| ### Change | ||
|
|
||
| * .github/*.yml steps updated to latest versions | ||
| * Better document use of `docker buildx ...` for local builds | ||
| * Better noted and organized the different build processes for PHP extensions | ||
| * Date component of PHP extension shared objects directory now a build argument | ||
| * Dockerfile base now based on `phpswoole/swoole:php8.5-alpine` | ||
| * Dockerfile compile and final stage system packages aligned | ||
| * GitHub action for container-structure-test now uses a marketplace action | ||
| * GitHub action runners pinned to Ubuntu 24.04 | ||
| * ImageMagick version bumped to 7.1.2.15 via APK | ||
| * PHP version bumped to 8.5 | ||
| * Refactored multi-arch build process to prevent cross-arch builds requiring long wait times | ||
|
|
||
| ### Fixes | ||
|
|
||
| * README.md usage instructions more detailed | ||
|
|
||
| ### Miscellaneous | ||
|
|
||
| ### Removed | ||
|
|
||
| * Build tools from final stage of Dockerfile | ||
| * GitHub action to Setup QEMU as GitHub now provides native ARM runners |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.