Skip to content

Commit 29ff2a4

Browse files
Xeratecdiaconuccalin
authored andcommitted
Use Docker digests instead of arch-specific tags (pulp-platform#106)
* Update action versions and fix missing id * Avoid platform-specific image tags by using digests in Docker manifest * Replaces per-architecture tags (e.g., *-amd64, *-arm64) with direct digest references when creating the multi-arch Docker manifest. This reduces tag clutter in the registry. * Update Changelog
1 parent 2111426 commit 29ff2a4

File tree

3 files changed

+49
-24
lines changed

3 files changed

+49
-24
lines changed

.github/workflows/BuildDockerDeeploy.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636
name: Build Deploy Image
3737
needs: [ prepare ]
3838
runs-on: ${{ matrix.runner }}
39+
outputs:
40+
digest-amd64: ${{ steps.digest.outputs.digest-amd64 }}
41+
digest-arm64: ${{ steps.digest.outputs.digest-arm64 }}
3942
strategy:
4043
fail-fast: false
4144
matrix:
@@ -57,17 +60,18 @@ jobs:
5760
haskell: true
5861
large-packages: true
5962

60-
- uses: docker/setup-buildx-action@v1
63+
- uses: docker/setup-buildx-action@v3
6164

6265
- name: GHCR Log-in
63-
uses: docker/login-action@v1
66+
uses: docker/login-action@v3
6467
with:
6568
registry: ghcr.io
6669
username: ${{ github.actor }}
6770
password: ${{ secrets.GITHUB_TOKEN }}
6871

6972
- name: Build Cache for Docker
70-
uses: actions/cache@v3
73+
id: cache
74+
uses: actions/cache@v4
7175
with:
7276
path: var-ccache
7377
key: ${{ runner.os }}-${{ matrix.platform }}-build-cache-deeploy
@@ -88,6 +92,7 @@ jobs:
8892
OWNER: '${{ github.repository_owner }}'
8993

9094
- name: Build and push final deploy image
95+
id: build
9196
uses: docker/build-push-action@v6
9297
with:
9398
platforms: linux/${{ matrix.platform }}
@@ -98,17 +103,19 @@ jobs:
98103
push: true
99104
build-args: |
100105
BASE_IMAGE=${{ github.event.inputs.docker_image_toolchain }}
101-
tags: |
102-
ghcr.io/${{ env.OWNER_LC }}/deeploy:latest-${{ matrix.platform }}
103-
ghcr.io/${{ env.OWNER_LC }}/deeploy:${{ needs.prepare.outputs.docker_tag }}-${{ matrix.platform }}
106+
outputs: type=image,name=ghcr.io/${{ env.OWNER_LC }}/deeploy,annotation-index=true,name-canonical=true,push=true
107+
108+
- name: Extract image digest
109+
id: digest
110+
run: echo "digest-${{ matrix.platform }}=${{ steps.build.outputs.digest }}" >> $GITHUB_OUTPUT
104111

105112
merge-deeploy-images:
106113
name: Merge Deeploy Images
107114
runs-on: ubuntu-latest
108115
needs: [ prepare, build-deeploy ]
109116
steps:
110117
- name: GHCR Log-in
111-
uses: docker/login-action@v1
118+
uses: docker/login-action@v3
112119
with:
113120
registry: ghcr.io
114121
username: ${{ github.actor }}
@@ -120,8 +127,13 @@ jobs:
120127
env:
121128
OWNER: '${{ github.repository_owner }}'
122129

123-
- uses: Noelware/docker-manifest-action@v1
130+
- name: Merge Deeploy Images
131+
uses: Noelware/docker-manifest-action@v1
124132
with:
125-
inputs: ghcr.io/${{ env.OWNER_LC }}/deeploy:latest-amd64,ghcr.io/${{ env.OWNER_LC }}/deeploy:latest-arm64
126-
tags: ghcr.io/${{ env.OWNER_LC }}/deeploy:latest,ghcr.io/${{ env.OWNER_LC }}/deeploy:${{ needs.prepare.outputs.docker_tag }}
133+
inputs: |
134+
ghcr.io/${{ env.OWNER_LC }}/deeploy@${{ needs.build-deeploy.outputs.digest-amd64 }},
135+
ghcr.io/${{ env.OWNER_LC }}/deeploy@${{ needs.build-deeploy.outputs.digest-arm64 }}
136+
tags: |
137+
ghcr.io/${{ env.OWNER_LC }}/deeploy:latest,
138+
ghcr.io/${{ env.OWNER_LC }}/deeploy:${{ needs.prepare.outputs.docker_tag }}
127139
push: true

.github/workflows/BuildDockerToolchain.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ jobs:
3131
name: Build Deeploy Toolchain Image
3232
needs: [ prepare ]
3333
runs-on: ${{ matrix.runner }}
34+
outputs:
35+
digest-amd64: ${{ steps.digest.outputs.digest-amd64 }}
36+
digest-arm64: ${{ steps.digest.outputs.digest-arm64 }}
3437
strategy:
3538
fail-fast: false
3639
matrix:
@@ -41,7 +44,7 @@ jobs:
4144
- platform: arm64
4245
runner: ubuntu-22.04-arm
4346
steps:
44-
- uses: actions/checkout@v2
47+
- uses: actions/checkout@v4
4548

4649
- name: Free up disk space
4750
uses: jlumbroso/[email protected]
@@ -51,17 +54,18 @@ jobs:
5154
haskell: true
5255
large-packages: true
5356

54-
- uses: docker/setup-buildx-action@v1
57+
- uses: docker/setup-buildx-action@v3
5558

5659
- name: GHCR Log-in
57-
uses: docker/login-action@v1
60+
uses: docker/login-action@v3
5861
with:
5962
registry: ghcr.io
6063
username: ${{ github.actor }}
6164
password: ${{ secrets.GITHUB_TOKEN }}
6265

6366
- name: Build Cache for Docker
64-
uses: actions/cache@v3
67+
id: cache
68+
uses: actions/cache@v4
6569
with:
6670
path: var-ccache
6771
key: ${{ runner.os }}-${{ matrix.platform }}-build-cache-toolchain
@@ -82,23 +86,26 @@ jobs:
8286
OWNER: '${{ github.repository_owner }}'
8387

8488
- name: Build and push toolchain image
89+
id: build
8590
uses: docker/build-push-action@v6
8691
with:
8792
platforms: linux/${{ matrix.platform }}
8893
context: .
8994
file: Container/Dockerfile.toolchain
9095
push: true
91-
tags: |
92-
ghcr.io/${{ env.OWNER_LC }}/deeploy-toolchain:latest-${{ matrix.platform }}
93-
ghcr.io/${{ env.OWNER_LC }}/deeploy-toolchain:${{ needs.prepare.outputs.docker_tag }}-${{ matrix.platform }}
96+
outputs: type=image,name=ghcr.io/${{ env.OWNER_LC }}/deeploy-toolchain,annotation-index=true,name-canonical=true,push=true
97+
98+
- name: Extract image digest
99+
id: digest
100+
run: echo "digest-${{ matrix.platform }}=${{ steps.build.outputs.digest }}" >> $GITHUB_OUTPUT
94101

95102
merge-toolchain-images:
96103
name: Merge Deeploy Toolchain Images
97104
runs-on: ubuntu-latest
98105
needs: [ prepare, build-toolchain ]
99106
steps:
100107
- name: GHCR Log-in
101-
uses: docker/login-action@v1
108+
uses: docker/login-action@v3
102109
with:
103110
registry: ghcr.io
104111
username: ${{ github.actor }}
@@ -110,8 +117,13 @@ jobs:
110117
env:
111118
OWNER: '${{ github.repository_owner }}'
112119

113-
- uses: Noelware/docker-manifest-action@v1
120+
- name: Merge Toolchain Images
121+
uses: Noelware/docker-manifest-action@v1
114122
with:
115-
inputs: ghcr.io/${{ env.OWNER_LC }}/deeploy-toolchain:latest-amd64,ghcr.io/${{ env.OWNER_LC }}/deeploy-toolchain:latest-arm64
116-
tags: ghcr.io/${{ env.OWNER_LC }}/deeploy-toolchain:latest,ghcr.io/${{ env.OWNER_LC }}/deeploy-toolchain:${{ needs.prepare.outputs.docker_tag }}
123+
inputs: |
124+
ghcr.io/${{ env.OWNER_LC }}/deeploy-toolchain@${{ needs.build-toolchain.outputs.digest-amd64 }},
125+
ghcr.io/${{ env.OWNER_LC }}/deeploy-toolchain@${{ needs.build-toolchain.outputs.digest-arm64 }}
126+
tags: |
127+
ghcr.io/${{ env.OWNER_LC }}/deeploy-toolchain:latest,
128+
ghcr.io/${{ env.OWNER_LC }}/deeploy-toolchain:${{ needs.prepare.outputs.docker_tag }}
117129
push: true

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ This file contains the changelog for the Deeploy project. The changelog is divid
44
## Unreleased (Planned Release Target: v0.2.1)
55
### List of Pull Requests
66
- Prepare Post v0.2.0 Release [#104](https://github.com/pulp-platform/Deeploy/pull/104)
7+
- Use Docker digests instead of arch-specific tags [#106](https://github.com/pulp-platform/Deeploy/pull/106)
78

89
### Added
9-
-
10+
- Output Docker image digests per platform (`amd64`, `arm64`) after build, which is used to construct the multi-arch Docker manifest. This preventes registry clutter caused by unnecessary per-architecture Docker tags.
1011

1112
### Changed
12-
-
13+
- Replaced platform-specific tags (`*-amd64`, `*-arm64`) with direct digest references in `Noelware/docker-manifest-action`.
1314

1415
### Fixed
15-
-
16+
- Resolved issue with missing `id` in the `Build Cache for Docker` step, used in the `Inject build-cache` step.
1617

1718
### Removed
1819
-

0 commit comments

Comments
 (0)