Skip to content

Upgrade local Docker registry from registry:2 to registry:3 in CI - #628

Merged
vharseko merged 2 commits into
masterfrom
copilot/upgrade-local-docker-registry
Apr 9, 2026
Merged

vharseko merged 2 commits into
masterfrom
copilot/upgrade-local-docker-registry

Conversation

Copilot AI commented Apr 8, 2026 •

Copy link
Copy Markdown
Contributor

registry:2 (v2.8.3) cannot reliably handle concurrent multi-platform blob uploads from BuildKit, causing widespread "blob unknown to registry" errors during multi-arch builds and a corrupted image that never passes the health check (exit 124).

Changes

  • .github/workflows/build.yml: Upgrade the local registry service container from registry:2 to registry:3 in both build-docker and build-docker-alpine jobs
-        image: registry:2
+        image: registry:3

registry:3 (CNCF Distribution v3.0.0+) ships with improved blob storage concurrency and OCI spec compliance directly addressing the multi-platform push failures.

Original prompt

Upgrade local Docker registry from registry:2 to registry:3 in CI workflow

Problem

The build-docker and build-docker-alpine jobs in .github/workflows/build.yml are failing because the local registry:2 (v2.8.3) service container cannot reliably handle concurrent multi-platform blob uploads from BuildKit during multi-architecture Docker image builds.

The logs show widespread "blob unknown to registry" errors during the push phase:

level=error msg="response completed with error" err.code="blob unknown" err.message="blob unknown to registry"

This results in corrupted/incomplete images being pushed to the local registry. The subsequent docker run + health check then times out (exit code 124) because the container never becomes healthy:

##[error]Process completed with exit code 124.

Failing job: https://github.com/OpenIdentityPlatform/OpenDJ/actions/runs/24140290532/job/70467743979

Solution

Upgrade the local registry service container from registry:2 to registry:3 in both the build-docker and build-docker-alpine jobs. The registry:3 image (CNCF Distribution v3.0.0+) includes improved blob storage handling, better concurrency support, and OCI spec compliance that resolves the multi-platform push issues.

Changes Required

In .github/workflows/build.yml, update two lines:

  1. Line 285 (build-docker job): Change image: registry:2 to image: registry:3
  2. Line 352 (build-docker-alpine job): Change image: registry:2 to image: registry:3

No other changes are needed.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.

Assistant:

I'll start by fetching the job logs and the workflow definition to understand the failure.

Assistant: Let me get more details from the workflow file and the full job logs to understand the build process better.

Assistant: ## Failing Job Analysis

Both the build-docker and build-docker-alpine jobs are failing. The root cause is the same for both:

Problem

The multi-platform Docker builds (using docker/build-push-action with QEMU) are pushing to a local registry:2 service container, but the "blob unknown to registry" errors during the push indicate that blobs from different platform builds are being lost or not properly stored in the local registry before the manifest list is assembled. This is a known issue when pushing multi-arch images to a local registry with BuildKit's default parallelism settings combined with the ephemeral nature of the registry service container.

After the push "succeeds" (despite the blob errors), the Docker test step pulls the image and tries to run it, but the container never becomes healthy within the 3-minute timeout:

##[error]Process completed with exit code 124.

Exit code 124 is the timeout command's exit code, meaning the container health check never passed — because the image was pushed with missing blobs/layers, resulting in a corrupted or incomplete image.

Solution

The workflow already sets max-parallelism = 1 in the BuildKit config, which is good. However, the issue is that the local registry:2 service container doesn't handle concurrent cross-platform blob uploads reliably. Here are the recommended fixes:

1. Use type=registry provenance and disable provenance/SBOM attestations

Attestation manifests can cause issues with registry v2. In both docker/build-push-action steps, add:

# In .github/workflows/build.yml, lines ~322-330 (build-docker) and ~389-399 (build-docker-alpine)
- name: Build image (default)
  uses: docker/build-push-action@v7
  with:
    context: ./opendj-packages/opendj-docker
    file: ./opendj-packages/opendj-docker/Dockerfile
    build-args: |
      VERSION=${{ env.release_version }}
    platforms: linux/amd64, linux/arm64/8, linux/ppc64le, linux/s390x
    push: true
    tags: ${{ steps.meta.outputs.tags }}
    labels: ${{ steps.meta.outputs.labels }}
    provenance: false   # <-- ADD THIS
    sbom: false         # <-- ADD THIS

Do the same for the alpine build step.

2. Upgrade the local registry to a newer version

The registry:2 image (v2.8.3 per the logs) has known issues with concurrent blob uploads. Use a newer distribution registry:

services:
  registry:
    image: registry:2.8.3    # or pin to a specific newer tag like registry:latest
    ports:
      - 5000:5000
    env:
      REGISTRY_STORAGE_DELETE_ENABLED: "true"
      REGISTRY_STORAGE_FILESYSTEM_MAXTHREADS: "100"

3. (Alternative) Use --load for single-platform test, push multi-arch separately

If the goal is just to test the Docker image in CI, you can build only linux/amd64 for the test step and avoid the lo...

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Upgrade local Docker registry from registry:2 to registry:3 Upgrade local Docker registry from registry:2 to registry:3 in CI Apr 8, 2026
Copilot AI requested a review from vharseko April 8, 2026 17:18
@vharseko
vharseko marked this pull request as ready for review April 9, 2026 07:34
@vharseko
vharseko merged commit 59f8920 into master Apr 9, 2026
17 checks passed
@vharseko
vharseko deleted the copilot/upgrade-local-docker-registry branch April 9, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants