From e5e58161872a2d7c7e509271eec0229509fc9377 Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Tue, 22 Oct 2024 17:03:30 +0200 Subject: [PATCH] feat: add request id commit --- .github/workflows/build.yml | 15 +++++++-------- caddy/Dockerfile | 14 +++++++++++--- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f117d6..df94811 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -106,7 +106,9 @@ jobs: caddy: name: Build Caddy with ${{ matrix.php }} - runs-on: ubuntu-latest + runs-on: shopware-arm64 + container: + image: ghcr.io/catthehacker/ubuntu:act-22.04 needs: [generate-matrix, fpm] strategy: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} steps: @@ -120,9 +122,6 @@ jobs: - name: Login into Github Docker Registery run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and Push uses: docker/build-push-action@v6 with: @@ -139,7 +138,9 @@ jobs: caddy-otel: name: Build Caddy ${{ matrix.php }} with OpenTelemetry - runs-on: ubuntu-latest + runs-on: shopware-arm64 + container: + image: ghcr.io/catthehacker/ubuntu:act-22.04 needs: [generate-matrix, fpm-otel] strategy: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} steps: @@ -147,14 +148,12 @@ jobs: uses: actions/checkout@v4 - name: Login into Docker Hub + if: github.ref == 'refs/heads/main' run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin - name: Login into Github Docker Registery run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and Push uses: docker/build-push-action@v6 with: diff --git a/caddy/Dockerfile b/caddy/Dockerfile index 5a8eeb3..9c34f0b 100644 --- a/caddy/Dockerfile +++ b/caddy/Dockerfile @@ -2,13 +2,21 @@ ARG FPM_IMAGE=ghcr.io/shopware/docker-base:8.3.1-fpm +FROM chainguard/wolfi-base AS caddy-builder + +RUN apk add --no-cache go xcaddy caddy-src + +ENV CGO_ENABLED=0 + +RUN xcaddy build --with github.com/caddyserver/caddy/v2=/usr/src/caddy --with github.com/lolPants/caddy-requestid --output /usr/bin/caddy + FROM ${FPM_IMAGE} USER root -RUN wget -O /etc/apk/keys/wolfi-signing.rsa.pub https://packages.wolfi.dev/os/wolfi-signing.rsa.pub && \ - apk add --no-cache --repository https://packages.wolfi.dev/os caddy && \ - ln -s /usr/bin/caddy /usr/sbin/caddy && \ +COPY --from=caddy-builder /usr/bin/caddy /usr/bin/caddy + +RUN ln -s /usr/bin/caddy /usr/sbin/caddy && \ apk add --no-cache supervisor USER www-data