From e250189385542b75b798552093b28911f9c4947e Mon Sep 17 00:00:00 2001 From: Xianpeng Shen Date: Wed, 13 Aug 2025 18:55:53 +0300 Subject: [PATCH 1/4] feat: support arm64 and alpine docker images (#100) * feat: support arm64 docker images * feat: support more alpine images * fix: add arm64 and alpine images * feat: add alpine images to ci * docs: update readme --- .github/workflows/CI.yml | 2 +- README.md | 4 ++++ docker-bake.hcl | 22 +++++++++++++--------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e6f742d..64ea16a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -23,7 +23,7 @@ jobs: build: strategy: matrix: - target: [ "all", "20", "19", "18", "17", "16", "16-alpine", "15", "14", "13", "12", "11", "10", "9", "8", "7"] + target: [ "all", "20", "20-alpine", "19", "19-alpine", "18", "18-alpine", "17", "17-alpine", "16", "16-alpine", "15", "14", "13", "12", "11", "10", "9", "8", "7"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/README.md b/README.md index 4e5f35a..1aefee2 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,13 @@ You can access all available Clang Tools Docker images via [Docker Hub registry * [`all`](https://github.com/cpp-linter/clang-tools-docker/blob/master/Dockerfile.all) (Supports versions of clang-tools includes `20`, `19`, `18`, `17`, `16`, `15`, `14`, `13`, `12`, `11`, `10`, `9`) * [`20`](https://github.com/cpp-linter/clang-tools-docker/blob/master/Dockerfile) +* [`20-alpine`](https://github.com/cpp-linter/clang-tools-docker/blob/master/Dockerfile.alpine) * [`19`](https://github.com/cpp-linter/clang-tools-docker/blob/master/Dockerfile) +* [`19-alpine`](https://github.com/cpp-linter/clang-tools-docker/blob/master/Dockerfile.alpine) * [`18`](https://github.com/cpp-linter/clang-tools-docker/blob/master/Dockerfile) +* [`18-alpine`](https://github.com/cpp-linter/clang-tools-docker/blob/master/Dockerfile.alpine) * [`17`](https://github.com/cpp-linter/clang-tools-docker/blob/master/Dockerfile) +* [`17-alpine`](https://github.com/cpp-linter/clang-tools-docker/blob/master/Dockerfile.alpine) * [`16`](https://github.com/cpp-linter/clang-tools-docker/blob/master/Dockerfile) * [`16-alpine`](https://github.com/cpp-linter/clang-tools-docker/blob/master/Dockerfile.alpine) * [`15`](https://github.com/cpp-linter/clang-tools-docker/blob/master/Dockerfile) diff --git a/docker-bake.hcl b/docker-bake.hcl index 2d064b1..2b15305 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -3,9 +3,13 @@ group "default" { targets = [ "all", "20", + "20-alpine", "19", + "19-alpine", "18", + "18-alpine", "17", + "17-alpine", "16", "16-alpine", "15", @@ -40,7 +44,7 @@ target "all" { "${DOCKER_REPO}:all", "${GITHUB_REPO}:all" ] - platforms = ["linux/amd64"] + platforms = ["linux/amd64", "linux/arm64"] } target "clang-tools" { @@ -59,7 +63,7 @@ target "clang-tools" { "${DOCKER_REPO}:${tgt}", "${GITHUB_REPO}:${tgt}" ] - platforms = ["linux/amd64"] + platforms = ["linux/amd64", "linux/arm64"] } target "clang-tools" { @@ -78,7 +82,7 @@ target "clang-tools" { "${DOCKER_REPO}:${tgt}", "${GITHUB_REPO}:${tgt}" ] - platforms = ["linux/amd64"] + platforms = ["linux/amd64", "linux/arm64"] } target "clang-tools" { @@ -97,7 +101,7 @@ target "clang-tools" { "${DOCKER_REPO}:${tgt}", "${GITHUB_REPO}:${tgt}" ] - platforms = ["linux/amd64"] + platforms = ["linux/amd64", "linux/arm64"] } target "clang-tools" { @@ -115,7 +119,7 @@ target "clang-tools" { "${DOCKER_REPO}:${tgt}", "${GITHUB_REPO}:${tgt}" ] - platforms = ["linux/amd64"] + platforms = ["linux/amd64", "linux/arm64"] } target "clang-tools" { @@ -133,7 +137,7 @@ target "clang-tools" { "${DOCKER_REPO}:${tgt}", "${GITHUB_REPO}:${tgt}" ] - platforms = ["linux/amd64"] + platforms = ["linux/amd64", "linux/arm64"] } target "clang-tools" { @@ -151,12 +155,12 @@ target "clang-tools" { "${DOCKER_REPO}:${tgt}", "${GITHUB_REPO}:${tgt}" ] - platforms = ["linux/amd64"] + platforms = ["linux/amd64", "linux/arm64"] } target "clang-tools" { matrix = { - tgt = ["16-alpine"] + tgt = ["16-alpine", "17-alpine", "18-alpine", "19-alpine", "20-alpine"] } name = "${tgt}" dockerfile = "Dockerfile.alpine" @@ -169,5 +173,5 @@ target "clang-tools" { "${DOCKER_REPO}:${tgt}", "${GITHUB_REPO}:${tgt}" ] - platforms = ["linux/amd64"] + platforms = ["linux/amd64", "linux/arm64"] } From c0fc9f41d0bff34dcbf4ec794903a15620edad2d Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Wed, 13 Aug 2025 19:00:01 +0300 Subject: [PATCH 2/4] remove condition to test --- .github/workflows/CI.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 64ea16a..d62841d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -43,7 +43,6 @@ jobs: run: docker buildx bake --file docker-bake.hcl --print - name: Build image for tag ${{ matrix.target }} - if: github.ref == 'refs/heads/master' run: docker buildx bake --file docker-bake.hcl ${{ matrix.target }} --load - name: Publish image for tag ${{ matrix.target }} From 54944b5c863b5623de63828fc91d8535e7520e24 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Wed, 13 Aug 2025 19:08:16 +0300 Subject: [PATCH 3/4] add output = [type=registry] --- docker-bake.hcl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docker-bake.hcl b/docker-bake.hcl index 2b15305..cf782b0 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -45,6 +45,7 @@ target "all" { "${GITHUB_REPO}:all" ] platforms = ["linux/amd64", "linux/arm64"] + output = ["type=registry"] } target "clang-tools" { @@ -64,6 +65,7 @@ target "clang-tools" { "${GITHUB_REPO}:${tgt}" ] platforms = ["linux/amd64", "linux/arm64"] + output = ["type=registry"] } target "clang-tools" { @@ -83,6 +85,7 @@ target "clang-tools" { "${GITHUB_REPO}:${tgt}" ] platforms = ["linux/amd64", "linux/arm64"] + output = ["type=registry"] } target "clang-tools" { @@ -102,6 +105,7 @@ target "clang-tools" { "${GITHUB_REPO}:${tgt}" ] platforms = ["linux/amd64", "linux/arm64"] + output = ["type=registry"] } target "clang-tools" { @@ -120,6 +124,7 @@ target "clang-tools" { "${GITHUB_REPO}:${tgt}" ] platforms = ["linux/amd64", "linux/arm64"] + output = ["type=registry"] } target "clang-tools" { @@ -138,6 +143,7 @@ target "clang-tools" { "${GITHUB_REPO}:${tgt}" ] platforms = ["linux/amd64", "linux/arm64"] + output = ["type=registry"] } target "clang-tools" { @@ -156,6 +162,7 @@ target "clang-tools" { "${GITHUB_REPO}:${tgt}" ] platforms = ["linux/amd64", "linux/arm64"] + output = ["type=registry"] } target "clang-tools" { @@ -174,4 +181,5 @@ target "clang-tools" { "${GITHUB_REPO}:${tgt}" ] platforms = ["linux/amd64", "linux/arm64"] + output = ["type=registry"] } From e9da180cb2eb0c4eb762b25f79b7543f107ca55c Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Wed, 13 Aug 2025 19:11:26 +0300 Subject: [PATCH 4/4] remove --load option --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d62841d..c4ac590 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -43,7 +43,7 @@ jobs: run: docker buildx bake --file docker-bake.hcl --print - name: Build image for tag ${{ matrix.target }} - run: docker buildx bake --file docker-bake.hcl ${{ matrix.target }} --load + run: docker buildx bake --file docker-bake.hcl ${{ matrix.target }} - name: Publish image for tag ${{ matrix.target }} if: github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch'