Skip to content

Foundation for removing go-containerregistry dependency#69

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/remove-go-containerregistry-dependency
Draft

Foundation for removing go-containerregistry dependency#69
Copilot wants to merge 3 commits intomainfrom
copilot/remove-go-containerregistry-dependency

Conversation

Copy link

Copilot AI commented Nov 14, 2025

Replaces Google's go-containerregistry with moby/docker ecosystem libraries. The project currently uses go-containerregistry across 60+ files for OCI image handling, registry operations, and reference parsing.

Changes

Created OCI compatibility layer (internal/oci/)

  • v1/ - Core OCI types (Hash, Descriptor, Manifest, Layer, Image interfaces) using opencontainers/image-spec
  • v1/types/ - MediaType constants for OCI and Docker image formats
  • v1/partial/ - Helper functions (Digest, ConfigName, Size, ConfigLayer)
  • name/ - Reference parsing using distribution/reference (moby)

All packages provide drop-in API compatibility with go-containerregistry.

Implementation guide

Added docs/REMOVE_GO_CONTAINERREGISTRY.md with:

  • Phase-by-phase migration plan (48-64 hours remaining)
  • Per-file migration templates
  • Testing strategy

Remaining work

Phase 1: Registry client using containerd/remotes/docker
Phase 2-4: Migrate 60+ files to use internal/oci/*
Phase 5: Remove go-containerregistry from go.mod

Example migration:

// Before
import v1 "github.com/google/go-containerregistry/pkg/v1"

// After  
import ociv1 "github.com/docker/model-runner/internal/oci/v1"

This PR establishes the architecture and provides working foundation types. The systematic migration follows incrementally to maintain test coverage and functionality.

Original prompt

Remove go-containerregistry as a dependency keeping all existing functionality, use moby as a dependency where appropriate


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits November 14, 2025 12:26
Added internal/oci package with:
- v1: Core OCI types (Hash, Descriptor, Manifest, Layer, Image interfaces)
- v1/types: Media type constants
- v1/partial: Helper functions for partial images
- name: Reference parsing using distribution/reference

These packages provide drop-in replacements for go-containerregistry types
using opencontainers/image-spec and moby/docker libraries.

Co-authored-by: ericcurtin <1694275+ericcurtin@users.noreply.github.com>
Co-authored-by: ericcurtin <1694275+ericcurtin@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove go-containerregistry dependency and use moby Foundation for removing go-containerregistry dependency Nov 14, 2025
Copilot AI requested a review from ericcurtin November 14, 2025 12:30
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