Skip to content

Commit bc3a644

Browse files
frostebiteclaude
andauthored
fix: migrate DockerHub tag check from V1 to V2 API (#281)
The DockerHub V1 API (index.docker.io/v1) has been decommissioned and returns 410 Gone. This caused docker_tag_exists checks to always fail, meaning builds never detected already-published images and rebuilt them unnecessarily (~30 min wasted per duplicate build). Migrate all 10 workflow files (6 Linux curl, 4 Windows PowerShell) to use the V2 API (hub.docker.com/v2) which returns 200 for existing tags and 404 for missing ones. This will significantly speed up the retry queue by skipping already-published images instead of rebuilding them. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 53b69c3 commit bc3a644

10 files changed

Lines changed: 15 additions & 15 deletions

.github/workflows/new-ubuntu-base-image-requested.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ jobs:
6060
password: ${{ secrets.DOCKERHUB_TOKEN }}
6161
- name: Check if image does not already exist
6262
run: |
63-
# Source: https://stackoverflow.com/a/39731444/3593896
63+
# DockerHub V2 API (V1 was decommissioned, returns 410 Gone)
6464
function docker_tag_exists() {
65-
curl --silent -f -lSL https://index.docker.io/v1/repositories/$1/tags/$2 > /dev/null
65+
curl --silent -f -lSL https://hub.docker.com/v2/repositories/$1/tags/$2 > /dev/null
6666
}
6767
6868
if docker_tag_exists unityci/base ubuntu-${{ github.event.client_payload.repoVersionFull }} ; then

.github/workflows/new-ubuntu-hub-image-requested.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ jobs:
6060
password: ${{ secrets.DOCKERHUB_TOKEN }}
6161
- name: Check if image does not already exist
6262
run: |
63-
# Source: https://stackoverflow.com/a/39731444/3593896
63+
# DockerHub V2 API (V1 was decommissioned, returns 410 Gone)
6464
function docker_tag_exists() {
65-
curl --silent -f -lSL https://index.docker.io/v1/repositories/$1/tags/$2 > /dev/null
65+
curl --silent -f -lSL https://hub.docker.com/v2/repositories/$1/tags/$2 > /dev/null
6666
}
6767
6868
if docker_tag_exists unityci/hub ubuntu-${{ github.event.client_payload.repoVersionFull }} ; then

.github/workflows/new-ubuntu-legacy-editor-image-requested.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ jobs:
7474
password: ${{ secrets.DOCKERHUB_TOKEN }}
7575
- name: Check if image does not already exist
7676
run: |
77-
# Source: https://stackoverflow.com/a/39731444/3593896
77+
# DockerHub V2 API (V1 was decommissioned, returns 410 Gone)
7878
function docker_tag_exists() {
79-
curl --silent -f -lSL https://index.docker.io/v1/repositories/$1/tags/$2 > /dev/null
79+
curl --silent -f -lSL https://hub.docker.com/v2/repositories/$1/tags/$2 > /dev/null
8080
}
8181
8282
if docker_tag_exists unityci/editor ubuntu-${{ github.event.client_payload.editorVersion }}-${{ matrix.targetPlatform }}-${{ github.event.client_payload.repoVersionFull }} ; then

.github/workflows/new-ubuntu-post-2019-2-editor-image-requested.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ jobs:
7474
password: ${{ secrets.DOCKERHUB_TOKEN }}
7575
- name: Check if image does not already exist
7676
run: |
77-
# Source: https://stackoverflow.com/a/39731444/3593896
77+
# DockerHub V2 API (V1 was decommissioned, returns 410 Gone)
7878
function docker_tag_exists() {
79-
curl --silent -f -lSL https://index.docker.io/v1/repositories/$1/tags/$2 > /dev/null
79+
curl --silent -f -lSL https://hub.docker.com/v2/repositories/$1/tags/$2 > /dev/null
8080
}
8181
8282
if docker_tag_exists unityci/editor ubuntu-${{ github.event.client_payload.editorVersion }}-${{ matrix.targetPlatform }}-${{ github.event.client_payload.repoVersionFull }} ; then

.github/workflows/new-windows-base-image-requested.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
param([string] $Repository, [string] $Tag)
123123
124124
Try {
125-
Invoke-RestMethod "https://index.docker.io/v1/repositories/$Repository/tags/$Tag"
125+
Invoke-RestMethod "https://hub.docker.com/v2/repositories/$Repository/tags/$Tag"
126126
} Catch {} # Assume image does not exist on erroneous response
127127
128128
return $?

.github/workflows/new-windows-hub-image-requested.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
param([string] $Repository, [string] $Tag)
123123
124124
Try {
125-
Invoke-RestMethod "https://index.docker.io/v1/repositories/$Repository/tags/$Tag"
125+
Invoke-RestMethod "https://hub.docker.com/v2/repositories/$Repository/tags/$Tag"
126126
} Catch {} # Assume image does not exist on erroneous response
127127
128128
return $?

.github/workflows/new-windows-legacy-editor-image-requested.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ jobs:
141141
param([string] $Repository, [string] $Tag)
142142
143143
Try {
144-
Invoke-RestMethod "https://index.docker.io/v1/repositories/$Repository/tags/$Tag"
144+
Invoke-RestMethod "https://hub.docker.com/v2/repositories/$Repository/tags/$Tag"
145145
} Catch {} # Assume image does not exist on erroneous response
146146
147147
return $?

.github/workflows/new-windows-post-2019-2-editor-image-requested.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ jobs:
148148
param([string] $Repository, [string] $Tag)
149149
150150
Try {
151-
Invoke-RestMethod "https://index.docker.io/v1/repositories/$Repository/tags/$Tag"
151+
Invoke-RestMethod "https://hub.docker.com/v2/repositories/$Repository/tags/$Tag"
152152
} Catch {} # Assume image does not exist on erroneous response
153153
154154
return $?

.github/workflows/retry-ubuntu-editor-image-requested.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ jobs:
5656
password: ${{ secrets.DOCKERHUB_TOKEN }}
5757
- name: Check if image does not already exist
5858
run: |
59-
# Source: https://stackoverflow.com/a/39731444/3593896
59+
# DockerHub V2 API (V1 was decommissioned, returns 410 Gone)
6060
function docker_tag_exists() {
61-
curl --silent -f -lSL https://index.docker.io/v1/repositories/$1/tags/$2 > /dev/null
61+
curl --silent -f -lSL https://hub.docker.com/v2/repositories/$1/tags/$2 > /dev/null
6262
}
6363
6464
if docker_tag_exists unityci/editor ubuntu-${{ github.event.client_payload.editorVersion }}-${{ github.event.client_payload.targetPlatform }}-${{ github.event.client_payload.repoVersionFull }} ; then

.github/workflows/retry-windows-editor-image-requested.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
param([string] $Repository, [string] $Tag)
8282
8383
Try {
84-
Invoke-RestMethod "https://index.docker.io/v1/repositories/$Repository/tags/$Tag"
84+
Invoke-RestMethod "https://hub.docker.com/v2/repositories/$Repository/tags/$Tag"
8585
} Catch {} # Assume image does not exist on erroneous response
8686
8787
return $?

0 commit comments

Comments
 (0)