Skip to content

Commit

Permalink
Merge branch 'master' into feature/nginx-1.25
Browse files Browse the repository at this point in the history
  • Loading branch information
patrikjuvonen committed Apr 23, 2024
2 parents a669a3c + 094205c commit 08c4e51
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 27 deletions.
136 changes: 136 additions & 0 deletions .github/workflows/ci-ghcr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: ci-ghcr

on:
push:
branches:
- "**"
tags:
- "v*.*.*"
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set Environment Variables
run: |
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
echo "VCS_REF=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/docker-nginx-http3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker build and push
id: build
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
build-args: |
BUILD_DATE=${{ env.BUILD_DATE }}
VCS_REF=${{ env.VCS_REF }}
GITHUB_REF=${{ github.ref }}
GITHUB_RUN_ID=${{ github.run_id }}
GITHUB_RUN_NUMBER=${{ github.run_number }}
GITHUB_RUN_ATTEMPT=${{ github.run_attempt }}
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Platform slug
id: platform-slug
run: echo "platform=${{ matrix.platform }}" | tr '/' '-' >> $GITHUB_OUTPUT

- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ steps.platform-slug.outputs.platform }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

merge:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/docker-nginx-http3
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,prefix=
type=sha,prefix=,format=long
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create manifest list and push
if: github.event_name != 'pull_request'
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/${{ github.repository_owner }}/docker-nginx-http3@sha256:%s ' *)
- name: Inspect images
run: |
docker buildx imagetools inspect ghcr.io/${{ github.repository_owner }}/docker-nginx-http3:${{ steps.meta.outputs.version }}
39 changes: 17 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@ jobs:
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.DOCKERHUB_USERNAME }}/docker-nginx-http3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Docker build and push
id: build
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ matrix.platform }}
Expand All @@ -72,10 +72,14 @@ jobs:
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Platform slug
id: platform-slug
run: echo "platform=${{ matrix.platform }}" | tr '/' '-' >> $GITHUB_OUTPUT

- name: Upload digest
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: digests
name: digests-${{ steps.platform-slug.outputs.platform }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
Expand All @@ -86,21 +90,21 @@ jobs:
- build
steps:
- name: Download digests
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: digests
path: /tmp/digests
pattern: digests-*
merge-multiple: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.DOCKERHUB_USERNAME }}/docker-nginx-http3
ghcr.io/${{ github.repository_owner }}/docker-nginx-http3
tags: |
type=schedule
type=ref,event=branch
Expand All @@ -113,19 +117,11 @@ jobs:
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create manifest list and push
if: github.event_name != 'pull_request'
working-directory: /tmp/digests
Expand All @@ -136,4 +132,3 @@ jobs:
- name: Inspect images
run: |
docker buildx imagetools inspect ${{ secrets.DOCKERHUB_USERNAME }}/docker-nginx-http3:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect ghcr.io/${{ github.repository_owner }}/docker-nginx-http3:${{ steps.meta.outputs.version }}
4 changes: 2 additions & 2 deletions .github/workflows/snyk-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
# Snyk can be used to break the build when it detects vulnerabilities.
# In this case we want to upload the issues to GitHub Code Scanning
continue-on-error: true
uses: snyk/actions/docker@299cde98a08ff8b1c2bfde1e5a067bce67a6d2b8
uses: snyk/actions/docker@8349f9043a8b7f0f3ee8885bf28f0b388d2446e8
env:
# In order to use the Snyk Action you will need to have a Snyk API token.
# More details in https://github.com/snyk/actions#getting-your-snyk-token
Expand All @@ -50,6 +50,6 @@ jobs:
image: patrikjuvonen/docker-nginx-http3:snyk-ci
args: --file=Dockerfile
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: snyk.sarif
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Docker Pulls](https://img.shields.io/docker/pulls/patrikjuvonen/docker-nginx-http3?color=brightgreen)](https://hub.docker.com/r/patrikjuvonen/docker-nginx-http3)
![MIT License](https://img.shields.io/github/license/patrikjuvonen/docker-nginx-http3)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md)
[![Build Status](https://github.com/patrikjuvonen/docker-nginx-http3/workflows/Build%20image/badge.svg?event=push&branch=master)](https://github.com/patrikjuvonen/docker-nginx-http3/actions?query=branch%3Amaster+event%3Apush)
[![Build Status](https://github.com/patrikjuvonen/docker-nginx-http3/actions/workflows/ci.yml/badge.svg?event=push)](https://github.com/patrikjuvonen/docker-nginx-http3/actions/workflows/ci.yml?event=push)
[![Arch](https://img.shields.io/badge/docker%20arch-linux%2Famd64-blue)](https://hub.docker.com/r/patrikjuvonen/docker-nginx-http3/tags)
[![Arch](https://img.shields.io/badge/docker%20arch-linux%2Farm64-blue)](https://hub.docker.com/r/patrikjuvonen/docker-nginx-http3/tags)
[![Arch](https://img.shields.io/badge/docker%20arch-linux%2Farm%2Fv7-blue)](https://hub.docker.com/r/patrikjuvonen/docker-nginx-http3/tags)
Expand All @@ -14,7 +14,7 @@ Alpine Linux image with nginx `1.23.4` (mainline) with HTTP/3 (QUIC), TLSv1.3,
and BoringSSL with OCSP support. All built on the bleeding edge. Built on the
edge, for the edge.

Total size is only about ~34 MB uncompressed and ~12 MB compressed.
Total size is only about ~47 MB uncompressed and ~12 MB compressed.

This is a fork of
[ranadeeppolavarapu/docker-nginx-http3](https://github.com/ranadeeppolavarapu/docker-nginx-http3).
Expand Down Expand Up @@ -45,7 +45,7 @@ Images for this are available on

Semantic versioning is enabled since [519e20d7f65d53b976cf7d13e364dca326e988b7](https://github.com/patrikjuvonen/docker-nginx-http3/commit/519e20d7f65d53b976cf7d13e364dca326e988b7),
the first semantic version being 2.0.0. You can use a semantical version using tags
such as `:2.1.1`, `:2.1`, `:2`. I also provide a `latest` tag which is the latest
such as `:x.y.z`, `:x.y`, `:x`. I also provide a `latest` tag which is the latest
release, and `master` which is the latest image from master branch.

This is a base image like the default _nginx_ image. It is meant to be used as a
Expand Down

0 comments on commit 08c4e51

Please sign in to comment.