|
28 | 28 | - name: Parse Alpine version
|
29 | 29 | id: distro_version
|
30 | 30 | run: |
|
31 |
| - echo "release=$(cat update.sh | grep -m7 '\[mainline\]=' | tail -n1 | cut -d"'" -f2)" >> "$GITHUB_OUTPUT" |
| 31 | + echo "release=$(cat update.sh | grep -m8 '\[mainline\]=' | tail -n1 | cut -d"'" -f2)" >> "$GITHUB_OUTPUT" |
32 | 32 |
|
33 | 33 | slim:
|
34 | 34 | name: Build Alpine NGINX mainline slim Docker image
|
@@ -383,3 +383,121 @@ jobs:
|
383 | 383 | DOCKER_CONTENT_TRUST_REPOSITORY_KEY_ID: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_KEY_ID }}
|
384 | 384 | DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }}
|
385 | 385 | NOTARY_TARGETS_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }}
|
| 386 | + |
| 387 | + otel: |
| 388 | + name: Build Alpine NGINX mainline otel Docker image |
| 389 | + needs: [version, core] |
| 390 | + runs-on: ubuntu-24.04 |
| 391 | + strategy: |
| 392 | + fail-fast: false |
| 393 | + steps: |
| 394 | + - name: Check out the codebase |
| 395 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 396 | + |
| 397 | + - name: Set up QEMU |
| 398 | + uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 |
| 399 | + |
| 400 | + - name: Set up Docker Buildx |
| 401 | + uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 |
| 402 | + |
| 403 | + - name: Configure AWS credentials |
| 404 | + if: ${{ github.event_name != 'pull_request' }} |
| 405 | + uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df # v4.2.1 |
| 406 | + with: |
| 407 | + aws-region: ${{ secrets.AWS_REGION }} |
| 408 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 409 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 410 | + |
| 411 | + - name: Login to Amazon ECR Public Gallery |
| 412 | + if: ${{ github.event_name != 'pull_request' }} |
| 413 | + uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 |
| 414 | + with: |
| 415 | + registry: public.ecr.aws |
| 416 | + |
| 417 | + - name: Login to Docker Hub |
| 418 | + if: ${{ github.event_name != 'pull_request' }} |
| 419 | + uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 |
| 420 | + with: |
| 421 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 422 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 423 | + |
| 424 | + - name: Login to GitHub Container Registry |
| 425 | + if: ${{ github.event_name != 'pull_request' }} |
| 426 | + uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 |
| 427 | + with: |
| 428 | + registry: ghcr.io |
| 429 | + username: ${{ github.actor }} |
| 430 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 431 | + |
| 432 | + - name: Login to Quay |
| 433 | + if: ${{ github.event_name != 'pull_request' }} |
| 434 | + uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 |
| 435 | + with: |
| 436 | + registry: quay.io |
| 437 | + username: ${{ secrets.QUAY_USERNAME }} |
| 438 | + password: ${{ secrets.QUAY_TOKEN }} |
| 439 | + |
| 440 | + - name: Extract metadata (annotations, labels, tags) for Docker |
| 441 | + id: meta |
| 442 | + uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0 |
| 443 | + with: |
| 444 | + images: | |
| 445 | + docker.io/nginxinc/nginx-unprivileged |
| 446 | + ghcr.io/nginx/nginx-unprivileged |
| 447 | + public.ecr.aws/nginx/nginx-unprivileged |
| 448 | + quay.io/nginx/nginx-unprivileged |
| 449 | + tags: | |
| 450 | + type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine-otel |
| 451 | + type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine${{ needs.version.outputs.distro }}-otel |
| 452 | + type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-alpine-otel |
| 453 | + type=raw,value=${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-alpine${{ needs.version.outputs.distro }}-otel |
| 454 | + type=raw,value=${{ needs.version.outputs.major }}-alpine-otel |
| 455 | + type=raw,value=${{ needs.version.outputs.major }}-alpine${{ needs.version.outputs.distro }}-otel |
| 456 | + type=raw,value=mainline-alpine-otel |
| 457 | + type=raw,value=mainline-alpine${{ needs.version.outputs.distro }}-otel |
| 458 | + type=raw,value=alpine-otel |
| 459 | + type=raw,value=alpine${{ needs.version.outputs.distro }}-otel |
| 460 | + env: |
| 461 | + DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index |
| 462 | + |
| 463 | + - name: Build and push NGINX mainline otel Alpine image to Amazon ECR Public Gallery, Docker Hub, GitHub Container Registry, and Quay |
| 464 | + id: build |
| 465 | + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 |
| 466 | + with: |
| 467 | + platforms: linux/amd64, linux/arm64 |
| 468 | + context: "{{ defaultContext }}:mainline/alpine-otel" |
| 469 | + labels: ${{ steps.meta.outputs.labels }} |
| 470 | + annotations: ${{ steps.meta.outputs.annotations }} |
| 471 | + tags: ${{ steps.meta.outputs.tags }} |
| 472 | + push: ${{ github.event_name != 'pull_request' }} |
| 473 | + # cache-from: type=gha,scope=alpine-otel |
| 474 | + # cache-to: type=gha,mode=min,scope=alpine-otel |
| 475 | + |
| 476 | + - name: Sign Docker Hub Manifest |
| 477 | + if: ${{ github.event_name != 'pull_request' }} |
| 478 | + run: | |
| 479 | + set -ex |
| 480 | + sudo apt update |
| 481 | + sudo apt install -y notary |
| 482 | + mkdir -p ~/.docker/trust/private |
| 483 | + echo "$DOCKER_CONTENT_TRUST_REPOSITORY_KEY" > ~/.docker/trust/private/$DOCKER_CONTENT_TRUST_REPOSITORY_KEY_ID.key |
| 484 | + chmod 0400 ~/.docker/trust/private/$DOCKER_CONTENT_TRUST_REPOSITORY_KEY_ID.key |
| 485 | + docker trust key load ~/.docker/trust/private/$DOCKER_CONTENT_TRUST_REPOSITORY_KEY_ID.key --name nginx |
| 486 | + DIGEST=$(printf '${{ steps.build.outputs.metadata }}' | jq -r '."containerimage.descriptor".digest' | cut -d ':' -f2) |
| 487 | + SIZE=$(printf '${{ steps.build.outputs.metadata }}' | jq -r '."containerimage.descriptor".size') |
| 488 | + export NOTARY_AUTH=$(printf "${{ secrets.DOCKERHUB_USERNAME }}:${{ secrets.DOCKERHUB_TOKEN }}" | base64 -w0) |
| 489 | + notary -d ~/.docker/trust/ -s https://notary.docker.io addhash docker.io/nginxinc/nginx-unprivileged ${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine-otel $SIZE --sha256 $DIGEST --publish --verbose |
| 490 | + notary -d ~/.docker/trust/ -s https://notary.docker.io addhash docker.io/nginxinc/nginx-unprivileged ${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine${{ needs.version.outputs.distro }}-otel $SIZE --sha256 $DIGEST --publish --verbose |
| 491 | + notary -d ~/.docker/trust/ -s https://notary.docker.io addhash docker.io/nginxinc/nginx-unprivileged ${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-alpine-otel $SIZE --sha256 $DIGEST --publish --verbose |
| 492 | + notary -d ~/.docker/trust/ -s https://notary.docker.io addhash docker.io/nginxinc/nginx-unprivileged ${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-alpine${{ needs.version.outputs.distro }}-otel $SIZE --sha256 $DIGEST --publish --verbose |
| 493 | + notary -d ~/.docker/trust/ -s https://notary.docker.io addhash docker.io/nginxinc/nginx-unprivileged ${{ needs.version.outputs.major }}-alpine-otel $SIZE --sha256 $DIGEST --publish --verbose |
| 494 | + notary -d ~/.docker/trust/ -s https://notary.docker.io addhash docker.io/nginxinc/nginx-unprivileged ${{ needs.version.outputs.major }}-alpine${{ needs.version.outputs.distro }}-otel $SIZE --sha256 $DIGEST --publish --verbose |
| 495 | + notary -d ~/.docker/trust/ -s https://notary.docker.io addhash docker.io/nginxinc/nginx-unprivileged mainline-alpine-otel $SIZE --sha256 $DIGEST --publish --verbose |
| 496 | + notary -d ~/.docker/trust/ -s https://notary.docker.io addhash docker.io/nginxinc/nginx-unprivileged mainline-alpine${{ needs.version.outputs.distro }}-otel $SIZE --sha256 $DIGEST --publish --verbose |
| 497 | + notary -d ~/.docker/trust/ -s https://notary.docker.io addhash docker.io/nginxinc/nginx-unprivileged alpine-otel $SIZE --sha256 $DIGEST --publish --verbose |
| 498 | + notary -d ~/.docker/trust/ -s https://notary.docker.io addhash docker.io/nginxinc/nginx-unprivileged alpine${{ needs.version.outputs.distro }}-otel $SIZE --sha256 $DIGEST --publish --verbose |
| 499 | + env: |
| 500 | + DOCKER_CONTENT_TRUST_REPOSITORY_KEY: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_KEY }} |
| 501 | + DOCKER_CONTENT_TRUST_REPOSITORY_KEY_ID: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_KEY_ID }} |
| 502 | + DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }} |
| 503 | + NOTARY_TARGETS_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }} |
0 commit comments