Publish Docker images to public registry

This commit is contained in:
2026-08-22 18:04:18 +01:00
parent a38d77ed23
commit 48ca873fe2
5 changed files with 31 additions and 6 deletions
+22 -1
View File
@@ -20,7 +20,7 @@ VERSION_FILE="$ENGINE_DIR/VERSION"
# attestation manifests, making the image an OCI image index. The Registry v2
# host at docker.dcglab.co.uk rejects those with a 500 on manifest PUT.
REGISTRY="${REGISTRY:-docker.dcglab.co.uk}"
IMAGE_ORG="${IMAGE_ORG:-}"
IMAGE_ORG="${IMAGE_ORG:-public}"
IMAGE_BASE="${REGISTRY}${IMAGE_ORG:+/${IMAGE_ORG}}/kb"
# Push retries — see push_image() below
@@ -106,6 +106,16 @@ run() {
fi
}
registry_login() {
echo " $ docker login $REGISTRY --username \$DOCKER_DCGLAB_CI_USERNAME --password-stdin"
[[ "$DRY_RUN" == true ]] && return 0
printf '%s' "$DOCKER_DCGLAB_CI_PASSWORD" |
docker login "$REGISTRY" \
--username "$DOCKER_DCGLAB_CI_USERNAME" \
--password-stdin
}
# Push one image tag, retrying on transient registry failures.
#
# The engine images carry a ~5.6GB torch layer. Uploading it intermittently
@@ -165,6 +175,17 @@ echo ""
echo "==> Pre-flight checks"
if [[ "$DRY_RUN" == false ]]; then
if [[ -z "${DOCKER_DCGLAB_CI_USERNAME:-}" ]]; then
echo "Error: DOCKER_DCGLAB_CI_USERNAME is required" >&2
exit 1
fi
if [[ -z "${DOCKER_DCGLAB_CI_PASSWORD:-}" ]]; then
echo "Error: DOCKER_DCGLAB_CI_PASSWORD is required" >&2
exit 1
fi
registry_login
if git -C "$SCRIPT_DIR" rev-parse "$GIT_TAG" &>/dev/null; then
echo "Error: tag $GIT_TAG already exists"
exit 1