GitHub Container Registry link to a repo

The help page says

The GitHub Container Registry supersedes the existing Packages Docker registry

I have two questions regarding Migrating to GitHub Container Registry for Docker images:

  1. Can I link a container in the new container registry to a repo, and will it show up under packages? If not currently, what is the roadmap and expected behavior once implemented?
  2. Now that I’m pushing to the new Container Registry, How can I delete a docker image in the old Packages Docker registry to prevent old images being used by mistake? :latest tag

Thanks!

  1. Yes! You can link to a repository via the OCI source label, here are 2 ways to do that. (Apologies as I thought this was in the docs)

The preferred method is via the Dockerfile like so:

# repo URL
LABEL org.opencontainers.image.source = "https://github.com/github/super-linter/"

Alternatively you can add this at build time like so:

docker build --label "org.opencontainers.image.source=https://github.com/github/super-linter/"
  1. We’re going to turn on delete for the old Docker images soon. Private images can be deleted immediately, public image deletion is coming. With the new service you’ll always be able to delete images and tags on your own.
2 Likes

Thanks! I tagged my images now it’s showing up on my user’s Packages tab. and the right repo is being displayed underneath both GCR and GPR versions.
image

However, only one being displayed under my repo’s packages page and it shows the GPR image.

I presume this won’t be a problem after the public image deletion feature is in : )

1 Like

Hi @clarkbw, When you say “You can link to a repository”, Do you mean the image will show up under the repo’s packages tab?

I published a public image for my repo and it’s showing correctly under repository source as follows:

However, it’s not showing under repo’s packages tab or anywhere on the repo page. Do we need to do anything else to get it to show up?

1 Like

@wei Yes! That’s the correct way to link the repo and the container. However right now it won’t show up in the repository page view yet. We’re waiting on some other fixes to go in and then it will start to appear as planned.

1 Like

Hello !

Is there a way to push images as public directly ? On my end everytime I push an image even linked (as mentioned above) to a public project, it still publish the image as private.

Not at this time. Images initially start as private and need to be switched. This should only need to be done once.

Can you explain a bit more about how you’re using this?

Well, I have a public repository: https://github.com/MaximeAubanel/GoGame

Initially I was releasing packages using docker.pkg.github.com. But I realized I couldn’t pull them without logging. Then I saw the new Docker Container Registry and tried it. It worked and I can pull images anonymously if they are public - but they were not so I had to move them to public manually. Then I came here to figure out how to link this image to a repo because images were not appearing on the project packages profile.

That’s basically it. I’m just thinking it is a bit odd to do it manually - but I guess it’s an upcoming feature. Maybe could be nice to default publish the image as public if it’s linked with a public repository.

1 Like

Yeah, its a little bit of a manual process right now. We’ll optimize it more soon so it’s easier to get the right defaults for new containers. Thanks for the feedback!

Is there an api call to switch the package from private to public?

We at linuxserver.io are updating our ci to push images to the new container registry but having a lot of issues with this default private marking.

Currently, only the user whose pat was used to upload the image can manage these images/packages. The other users of the organization (including the owners) cannot even see the packages listed as they are not listed in access management. This forces a manual interaction on a single member of the team for each image (we have hundreds) which is not ideal for an org with ci/cd.

Thanks

1 Like

Hello @aptalca! Can you email me? clarkbw @github.com We’ve got a system that solves for this very issue that we’re using internally but its not yet ready to roll out. Happy to have you try it and get your feedback. Thanks!

2 Likes