Skip to content

Commit d602dea

Browse files
committed
util-docker: Dockerfiles cleanup
1 parent 0fd91a0 commit d602dea

File tree

2 files changed

+44
-8
lines changed

2 files changed

+44
-8
lines changed

.github/workflows/docker-build.yaml

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
22
name: Docker images build and push
33

4-
#on:
5-
# push:
6-
# branches:
7-
# - 'develop'
8-
# paths:
9-
# - util/dockerfiles/**
104
on:
5+
push:
6+
branches:
7+
- develop
8+
paths:
9+
- util/dockerfiles/**
1110
workflow_dispatch:
1211

1312

@@ -20,7 +19,7 @@ jobs:
2019

2120
steps:
2221
- name: Checkout
23-
uses: actions/checkout@v4
22+
uses: actions/checkout@v3
2423

2524
- name: List targets
2625
id: generate
@@ -29,13 +28,44 @@ jobs:
2928
target: default
3029
workdir: util/dockerfiles
3130

32-
docker-buildx-bake:
31+
docker-buildx-bake-base-images:
32+
# This job is used to build the base images -- the images which other
33+
# images use as a base (usually an Ubuntu release).
34+
# We do this prior to building the other images to ensure that the base
35+
# are available when building the other images.
36+
runs-on: [self-hosted, linux, x64]
37+
steps:
38+
- name: Set up QEMU
39+
uses: docker/setup-qemu-action@v3
40+
41+
- name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v3
43+
44+
- name: Login to GitHub Container Registry
45+
uses: docker/login-action@v3
46+
with:
47+
registry: ghcr.io
48+
username: ${{ github.repository_owner }}
49+
password: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Build and Push
52+
uses: docker/bake-action@v6
53+
with:
54+
source: '{{defaultContext}}:util/dockerfiles'
55+
targets: base-images
56+
provenance: true
57+
push: true
58+
59+
docker-buildx-bake-all:
3360
runs-on: [self-hosted, linux, x64]
3461
needs:
3562
- obtain-targets
63+
- docker-buildx-bake-base-images
3664

3765
strategy:
3866
fail-fast: false
67+
# Limit the number of parallel jobs to not overwhelm the runners
68+
max-parallel: 4
3969
matrix:
4070
target: ${{ fromJSON(needs.obtain-targets.outputs.targets) }}
4171

util/dockerfiles/docker-bake.hcl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ target "common" {
5353
dockerfile = "Dockerfile"
5454
}
5555

56+
group "base-images" {
57+
targets = [
58+
"ubuntu-24-04_all-dependencies",
59+
]
60+
}
61+
5662
# A group of targets to be built. Note: groups can contain other groups.
5763
# Any target or group can be build individually. I.e.:
5864
# `docker buildx bake --push ubuntu-20-04_all-dependencies` or

0 commit comments

Comments
 (0)