Skip to content

Commit 59ca169

Browse files
author
Moaad Khamlich
committed
FIX: resolve Docker multi-arch build push-by-digest conflict
Remove conflicting push parameter from outputs configuration that was causing "can't push tagged ref by digest" errors in the multi-arch build workflow.
1 parent e51de71 commit 59ca169

File tree

2 files changed

+13
-25
lines changed

2 files changed

+13
-25
lines changed

.github/workflows/docker-publish.yml

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
name: Build and Push Multi-Arch Docker Images
22

33
on:
4-
push:
5-
branches: [ "Docker" ]
4+
release:
5+
types: [published]
6+
workflow_dispatch:
67

78
env:
89
REGISTRY: docker.io
9-
IMAGE_NAME: ithacafv/ithaca-fv
10+
IMAGE_NAME: ithacafv/ithacafv
1011

1112
jobs:
1213
build-amd64:
@@ -36,24 +37,19 @@ jobs:
3637
with:
3738
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3839
tags: |
39-
type=ref,event=branch
40-
type=ref,event=pr
4140
type=semver,pattern={{version}}
42-
type=semver,pattern={{major}}.{{minor}}
43-
type=raw,value=latest,enable={{is_default_branch}}
41+
type=raw,value=latest
4442
4543
- name: Build and push AMD64 image
4644
id: build
4745
uses: docker/build-push-action@v5
4846
with:
4947
context: ./dockerfiles/OF2412
5048
platforms: linux/amd64
51-
push: ${{ github.event_name != 'pull_request' }}
52-
tags: ${{ steps.meta.outputs.tags }}
5349
labels: ${{ steps.meta.outputs.labels }}
5450
cache-from: type=gha
5551
cache-to: type=gha,mode=max
56-
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }}
52+
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
5753

5854
build-arm64:
5955
runs-on: ubuntu-24.04-arm
@@ -82,24 +78,19 @@ jobs:
8278
with:
8379
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
8480
tags: |
85-
type=ref,event=branch
86-
type=ref,event=pr
8781
type=semver,pattern={{version}}
88-
type=semver,pattern={{major}}.{{minor}}
89-
type=raw,value=latest,enable={{is_default_branch}}
82+
type=raw,value=latest
9083
9184
- name: Build and push ARM64 image
9285
id: build
9386
uses: docker/build-push-action@v5
9487
with:
9588
context: ./dockerfiles/OF2412
9689
platforms: linux/arm64
97-
push: ${{ github.event_name != 'pull_request' }}
98-
tags: ${{ steps.meta.outputs.tags }}
9990
labels: ${{ steps.meta.outputs.labels }}
10091
cache-from: type=gha
10192
cache-to: type=gha,mode=max
102-
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }}
93+
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
10394

10495
merge:
10596
runs-on: ubuntu-latest
@@ -123,11 +114,8 @@ jobs:
123114
with:
124115
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
125116
tags: |
126-
type=ref,event=branch
127-
type=ref,event=pr
128117
type=semver,pattern={{version}}
129-
type=semver,pattern={{major}}.{{minor}}
130-
type=raw,value=latest,enable={{is_default_branch}}
118+
type=raw,value=latest
131119
132120
- name: Create and push manifest list
133121
working-directory: /tmp
@@ -136,4 +124,4 @@ jobs:
136124
${{ needs.build-amd64.outputs.digest }} \
137125
${{ needs.build-arm64.outputs.digest }}
138126
env:
139-
DOCKER_METADATA_OUTPUT_JSON: ${{ needs.build-amd64.outputs.metadata }}
127+
DOCKER_METADATA_OUTPUT_JSON: ${{ steps.meta.outputs.json }}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ These images are based **OpenFOAM-v2106**, and provided an isolated environment,
8888
In order to pull the image, run the following command:
8989

9090
```
91-
docker pull ithacafv/ithacafv:manifest-latest
91+
docker pull ithacafv/ithacafv:latest
9292
```
9393

9494
Once the image is downloaded, you can start the container and mount the $HOME directory by executing:
9595

9696
```
97-
docker run -ti --rm -v "${HOME}:/home/ithacafv/${USER}" ithacafv/ithacafv:manifest-latest
97+
docker run -ti --rm -v "${HOME}:/home/ithacafv/${USER}" ithacafv/ithacafv:latest
9898
```
9999

100100
### 4. Singularity
@@ -114,7 +114,7 @@ export SINGULARITY_CACHEDIR=$HOME/mycontainter
114114
Buidling singularity image file `.sif` from the docker image, which is build and stored in `$HOME/mycontainter`, The below image used is based **OpenFOAM-v2106**, and where you can find a compiled version of the master branch of **ITHACA-FV**.
115115

116116
```
117-
singularity build ithacafv.sif docker://ithacafv/ithacafv:manifest-latest
117+
singularity build ithacafv.sif docker://ithacafv/ithacafv:latest
118118
```
119119

120120
To view / list all the images/cache,

0 commit comments

Comments
 (0)