Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,27 @@ concurrency:
cancel-in-progress: true

jobs:
extract-targets:
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.extract.outputs.targets }}
steps:
- uses: actions/checkout@v4
- name: Extract targets as JSON array
id: extract
uses: dcarbone/install-jq-action@v2
- name: Get targets from bake file
id: get-targets
run: |
TARGETS=$(docker buildx bake --file docker-bake.hcl --print | jq -c '[.target | keys[] | select(. != "default")]')
echo "targets=$TARGETS" | tee -a ${GITHUB_OUTPUT}

build:
needs: extract-targets
runs-on: ubuntu-latest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
runs-on: ubuntu-latest

strategy:
matrix:
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"]
target: ${{ fromJson(needs.extract-targets.outputs.targets) }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this idea.

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
229 changes: 203 additions & 26 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,204 @@
group "default" {
targets = [
"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",
"20", "20-alpine",
"19", "19-alpine",
"18", "18-alpine",
"17", "17-alpine",
"16", "16-alpine",
"15", "15-alpine",
"14", "14-alpine",
"13", "13-alpine",
"12", "12-alpine",
"11", "11-alpine",
"10", "10-alpine",
"9", "9-alpine",
"8", "8-alpine",
"7", "7-alpine",
]
}
# ---- Alpine targets ----
target "20-alpine" {
dockerfile = "Dockerfile.alpine"
context = "."
args = {
BASE_IMAGE = "alpine:3.18"
CLANG_VERSION = "20"
}
tags = [
"${DOCKER_REPO}:20-alpine",
"${GITHUB_REPO}:20-alpine"
]
platforms = ["linux/amd64", "linux/arm64"]
}

target "19-alpine" {
dockerfile = "Dockerfile.alpine"
context = "."
args = {
BASE_IMAGE = "alpine:3.18"
CLANG_VERSION = "19"
}
tags = [
"${DOCKER_REPO}:19-alpine",
"${GITHUB_REPO}:19-alpine"
]
platforms = ["linux/amd64", "linux/arm64"]
}

target "18-alpine" {
dockerfile = "Dockerfile.alpine"
context = "."
args = {
BASE_IMAGE = "alpine:3.18"
CLANG_VERSION = "18"
}
tags = [
"${DOCKER_REPO}:18-alpine",
"${GITHUB_REPO}:18-alpine"
]
platforms = ["linux/amd64", "linux/arm64"]
}

target "17-alpine" {
dockerfile = "Dockerfile.alpine"
context = "."
args = {
BASE_IMAGE = "alpine:3.18"
CLANG_VERSION = "17"
}
tags = [
"${DOCKER_REPO}:17-alpine",
"${GITHUB_REPO}:17-alpine"
]
platforms = ["linux/amd64", "linux/arm64"]
}

target "15-alpine" {
dockerfile = "Dockerfile.alpine"
context = "."
args = {
BASE_IMAGE = "alpine:3.18"
CLANG_VERSION = "15"
}
tags = [
"${DOCKER_REPO}:15-alpine",
"${GITHUB_REPO}:15-alpine"
]
platforms = ["linux/amd64", "linux/arm64"]
}

target "14-alpine" {
dockerfile = "Dockerfile.alpine"
context = "."
args = {
BASE_IMAGE = "alpine:3.18"
CLANG_VERSION = "14"
}
tags = [
"${DOCKER_REPO}:14-alpine",
"${GITHUB_REPO}:14-alpine"
]
platforms = ["linux/amd64", "linux/arm64"]
}

target "13-alpine" {
dockerfile = "Dockerfile.alpine"
context = "."
args = {
BASE_IMAGE = "alpine:3.18"
CLANG_VERSION = "13"
}
tags = [
"${DOCKER_REPO}:13-alpine",
"${GITHUB_REPO}:13-alpine"
]
platforms = ["linux/amd64", "linux/arm64"]
}

target "12-alpine" {
dockerfile = "Dockerfile.alpine"
context = "."
args = {
BASE_IMAGE = "alpine:3.18"
CLANG_VERSION = "12"
}
tags = [
"${DOCKER_REPO}:12-alpine",
"${GITHUB_REPO}:12-alpine"
]
platforms = ["linux/amd64", "linux/arm64"]
}

target "11-alpine" {
dockerfile = "Dockerfile.alpine"
context = "."
args = {
BASE_IMAGE = "alpine:3.18"
CLANG_VERSION = "11"
}
tags = [
"${DOCKER_REPO}:11-alpine",
"${GITHUB_REPO}:11-alpine"
]
platforms = ["linux/amd64", "linux/arm64"]
}

target "10-alpine" {
dockerfile = "Dockerfile.alpine"
context = "."
args = {
BASE_IMAGE = "alpine:3.18"
CLANG_VERSION = "10"
}
tags = [
"${DOCKER_REPO}:10-alpine",
"${GITHUB_REPO}:10-alpine"
]
platforms = ["linux/amd64", "linux/arm64"]
}

target "9-alpine" {
dockerfile = "Dockerfile.alpine"
context = "."
args = {
BASE_IMAGE = "alpine:3.18"
CLANG_VERSION = "9"
}
tags = [
"${DOCKER_REPO}:9-alpine",
"${GITHUB_REPO}:9-alpine"
]
platforms = ["linux/amd64", "linux/arm64"]
}

target "8-alpine" {
dockerfile = "Dockerfile.alpine"
context = "."
args = {
BASE_IMAGE = "alpine:3.18"
CLANG_VERSION = "8"
}
tags = [
"${DOCKER_REPO}:8-alpine",
"${GITHUB_REPO}:8-alpine"
]
platforms = ["linux/amd64", "linux/arm64"]
}

target "7-alpine" {
dockerfile = "Dockerfile.alpine"
context = "."
args = {
BASE_IMAGE = "alpine:3.18"
CLANG_VERSION = "7"
}
tags = [
"${DOCKER_REPO}:7-alpine",
"${GITHUB_REPO}:7-alpine"
]
platforms = ["linux/amd64", "linux/arm64"]
}

# ---- variables ----
variable "DOCKER_REPO" {
Expand All @@ -38,7 +215,7 @@ target "all" {
dockerfile = "Dockerfile.all"
context = "."
args = {
BASE_IMAGE="ubuntu:20.04"
BASE_IMAGE="ubuntu:24.04"
}
tags = [
"${DOCKER_REPO}:all",
Expand All @@ -57,7 +234,7 @@ target "clang-tools" {
context = "."
args = {
# https://packages.ubuntu.com/search?suite=default&section=all&arch=any&keywords=clang-format-20&searchon=names
BASE_IMAGE="ubuntu:plucky"
BASE_IMAGE="ubuntu:24.04"
CLANG_VERSION="${tgt}",
}
tags = [
Expand All @@ -77,7 +254,7 @@ target "clang-tools" {
context = "."
args = {
# https://packages.ubuntu.com/search?suite=default&section=all&arch=any&keywords=clang-format-19&searchon=names
BASE_IMAGE="ubuntu:oracular"
BASE_IMAGE="ubuntu:24.04"
CLANG_VERSION="${tgt}",
}
tags = [
Expand All @@ -97,7 +274,7 @@ target "clang-tools" {
context = "."
args = {
# https://packages.ubuntu.com/search?suite=default&section=all&arch=any&keywords=clang-format-18&searchon=names
BASE_IMAGE="ubuntu:noble"
BASE_IMAGE="ubuntu:24.04"
CLANG_VERSION="${tgt}",
}
tags = [
Expand All @@ -116,7 +293,7 @@ target "clang-tools" {
dockerfile = "Dockerfile"
context = "."
args = {
BASE_IMAGE="ubuntu:24.10"
BASE_IMAGE="ubuntu:24.04"
CLANG_VERSION="${tgt}",
}
tags = [
Expand All @@ -135,7 +312,7 @@ target "clang-tools" {
dockerfile = "Dockerfile"
context = "."
args = {
BASE_IMAGE="ubuntu:22.04"
BASE_IMAGE="ubuntu:24.04"
CLANG_VERSION="${tgt}",
}
tags = [
Expand All @@ -154,7 +331,7 @@ target "clang-tools" {
dockerfile = "Dockerfile"
context = "."
args = {
BASE_IMAGE="ubuntu:20.04"
BASE_IMAGE="ubuntu:24.04"
CLANG_VERSION="${tgt}",
}
tags = [
Expand Down
Loading