From fbf06f624ee80d102228182c5d96b2cef500e97a Mon Sep 17 00:00:00 2001 From: Joonas Bergius Date: Mon, 23 Sep 2024 14:37:08 -0500 Subject: [PATCH] feat: Add wolfi image (#430) Signed-off-by: Joonas Bergius --- .github/workflows/release.yml | 26 ++++++++++++++++++++++++++ Dockerfile.wolfi | 17 +++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 Dockerfile.wolfi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5a0a8592..23d89563 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -225,6 +225,19 @@ jobs: BIN_AMD64=./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-amd64 tags: ghcr.io/${{ env.OWNER }}/wadm:latest,ghcr.io/${{ env.OWNER }}/wadm:${{ env.RELEASE_VERSION }} + - name: Build and push wolfi (tag) + uses: docker/build-push-action@v6 + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + with: + push: true + platforms: linux/amd64,linux/arm64 + context: ./ + file: ./Dockerfile.wolfi + build-args: | + BIN_ARM64=./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-aarch64 + BIN_AMD64=./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-amd64 + tags: ghcr.io/${{ env.OWNER }}/wadm:latest-wolfi,ghcr.io/${{ env.OWNER }}/wadm:${{ env.RELEASE_VERSION }}-wolfi + - name: Build and push (main) uses: docker/build-push-action@v6 if: ${{ github.ref == 'refs/heads/main' }} @@ -236,3 +249,16 @@ jobs: BIN_ARM64=./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-aarch64 BIN_AMD64=./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-amd64 tags: ghcr.io/${{ env.OWNER }}/wadm:canary + + - name: Build and push (main) + uses: docker/build-push-action@v6 + if: ${{ github.ref == 'refs/heads/main' }} + with: + push: true + platforms: linux/amd64,linux/arm64 + context: ./ + file: ./Dockerfile.wolfi + build-args: | + BIN_ARM64=./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-aarch64 + BIN_AMD64=./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-amd64 + tags: ghcr.io/${{ env.OWNER }}/wadm:canary-wolfi \ No newline at end of file diff --git a/Dockerfile.wolfi b/Dockerfile.wolfi new file mode 100644 index 00000000..69e0086e --- /dev/null +++ b/Dockerfile.wolfi @@ -0,0 +1,17 @@ +FROM chainguard/wolfi-base:latest AS base + +FROM base AS base-amd64 +ARG BIN_AMD64 +ARG BIN=$BIN_AMD64 + +FROM base AS base-arm64 +ARG BIN_ARM64 +ARG BIN=$BIN_ARM64 + +FROM base-$TARGETARCH + +# Copy application binary from disk +COPY ${BIN} /usr/local/bin/wadm + +# Run the application +ENTRYPOINT ["/usr/local/bin/wadm"]