Packages Docker migration to Container registry will affect GraphQL queries

:wave: If you’re using the GitHub GraphQL API to work with your GitHub Packages Docker registry images you’ll need to make changes once your account or organization has been migrated to the GitHub Packages Container registry. Migration of all Docker registry images will happen over the next several weeks after the Container registry becomes generally available.

GraphQL queries transition to REST API calls

A GraphQL query for DOCKER like this will return empty results post-migration but the REST API is already returning results for both systems.

{
  viewer { # DOCKER is now deprecated
    packages(first: 100, packageType:DOCKER, names:"alpine") {
      totalCount
      nodes {
        packageType,
        name,
        versions(first:100) {
          nodes{
            id
            version
          }
        }
      }
    }
  }
}

Once your Docker images have been migrated the above query will return an empty set and you’ll need to switch to using the Packages REST API for querying versions and interacting with the Container registry APIs.

Right now you can transition the above GraphQL to the following REST call for the organization ORG and get all your docker images returned. This will work pre and post migration.

curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/packages/docker/alpine/versions

Background

The docker.pkg.github.com and ghcr.io are 2 different services and Docker is being migrated into Containers. Once GHCR leaves Beta and becomes GA (generally available) in about 2 weeks GitHub will begin seamlessly migrating all the images on the Docker registry over to the Container registry. Customers should experience no interruptions or changes other than an upgrade to the new and improved Container registry service. However the GraphQL queries for Docker images will no longer return results and you will need to use the REST API (with the same authentication) to query for your Docker images. Eventually (in a quarter or two) the GraphQL query for DOCKER will error as it is removed from the system.

1 Like