Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support third-party registries #869

Closed
5 of 21 tasks
StephenWeatherford opened this issue Mar 27, 2019 · 48 comments · Fixed by #4026
Closed
5 of 21 tasks

Support third-party registries #869

StephenWeatherford opened this issue Mar 27, 2019 · 48 comments · Fixed by #4026

Comments

@StephenWeatherford
Copy link
Contributor

StephenWeatherford commented Mar 27, 2019

Specifically requested (but goal is generic support), in no particular order:

Open:

Blocked on no/partial Registry V2 support:

Done:

@gauravlakhani
Copy link

while connecting using private registry option, is private Docker DTR (Enterprise Docker trusted registry) supported at all?

@StephenWeatherford
Copy link
Contributor Author

@gauravlakhani Support for registries beyond Docker Hub is fairly new, we haven't tested on DTR. I've added it to the list.

@shaneholloman
Copy link

@here champion!

@imkhairulikhwan
Copy link

Hi, do we have an estimated date for this to complete?

@Nhimself
Copy link

Following this...

@bwateratmsft
Copy link
Contributor

bwateratmsft commented Feb 21, 2020

@BigMorty I think that we should take this one for 1.1...

@BigMorty
Copy link
Member

BigMorty commented Feb 21, 2020

Agree we should try to get it into 1.1 or 1.2

@bwateratmsft bwateratmsft self-assigned this Feb 24, 2020
@bwateratmsft bwateratmsft modified the milestones: Future, 0.12.0 Feb 24, 2020
@bwateratmsft
Copy link
Contributor

This could potentially require and/or take advantage of microsoft/vscode#88309

@bwateratmsft
Copy link
Contributor

bwateratmsft commented Feb 27, 2020

I've spent a lot of time researching in the past few days. Unfortunately this is going to be extremely difficult, due to two main issues:

  1. No / incomplete Registry V2 API support
  2. OAuth flows totally inconsistent with each other and with the spec
    • Azure and Quay require a web page sign-in
    • Docker Hub has a hilariously broken auth flow--it issues tokens regardless of anything (though the tokens will not work), and does not issue refresh tokens even when asked for them, and does not accept POST's for OAuth tokens like the spec says
    • GCR and ECR use credential helpers--not something we can use easily
    • Quay requires the users to create a client application, and provide its ID to any clients (e.g. this extension). Possible, but onerously difficult.
    • goharbor.io might be the only one with a proper implementation that also permits password auth? At least, their docs sound like it.

Implementing support for each registry with their own custom APIs is a non-starter. Dealing with the OAuth flows is possible, but guaranteed to result in a lot of bad user experiences, due to the complexity and prerequisite setup that most of them demand.

@alexfricker
Copy link

alexfricker commented May 6, 2023

+1 for Gitlab self-hosted.

it does look like self hosted uses v2 and _catalog endpoint fwiw

@Mk-arc
Copy link

Mk-arc commented Jun 22, 2023

+1 for Gitlab self-hosted.

@OperativeThunny
Copy link

+1 for Gitlab self-hosted for me as well. My environment is very constrained so I tried setting up a personal access token in the gitlab self hosted instance, but there is no way using the generic docker option or the gitlab option to connect (tried editing hosts file to point gitlab.com to self hosted instance, but that did not work the url it attempted was a 404)

@mjgardner
Copy link

@bwateratmsft wrote:

  1. No / incomplete Registry V2 API support

    • GitLab has no V2 API support at all, but instead a custom API

Then @alexfricker wrote:

it does look like self hosted uses v2 and _catalog endpoint fwiw

GitLab’s Container Registry API documentation lists instance-wide Docker V2 API endpoints apart from their custom API. It looks like one just uses HTTP Basic Auth with the username and password (or Personal Access Token if using 2FA) as part of the first request for a Bearer token.

@Hyperclaw79
Copy link

Is the Github integration completed? I am able to add the Registry and push to it but I'm seeing an error message when trying to list the packages.
image

This is the complete error message:
Error: Request with GET/HEAD method cannot have body

Is this related to the discussion regarding GHCR now having _catalog or am I missing something?

@bwateratmsft
Copy link
Contributor

GitHub Container Registry is not yet supported but we are actively working on a significant revamp of the registries functionality, and have included support of GitHub in that work.

@Hyperclaw79
Copy link

@bwateratmsft
Great! Thank you for the information. Looking forward to the completion of all the different container registries so that I can manage them all from one place.
Are there any plans for UI implementations for migrating/cloning the images between multiple registries?
I think there is a CLI tool called Crane for such tasks but having a built-in functionality for it in vscode would be a blessing.

@bwateratmsft
Copy link
Contributor

That wasn't in the plan but you could create a new issue to suggest that.

@bwateratmsft
Copy link
Contributor

A fix for this has, at long last, been released. We know this was one of our most popular asks and we wanted to make sure we got it right. Anyone who wants to add support for a registry can now do so. This means nobody has to wait for us to add support for a registry--you can easily do it yourself!

Starting from https://github.com/microsoft/vscode-docker-extensibility/tree/main/packages/vscode-docker-registries (and the associated NPM package), you can either directly implement the RegistryDataProvider interface, or more easily, extend the CommonRegistryDataProvider class, or RegistryV2DataProvider class if your registry implements the V2 spec. The actual implementations for Docker Hub, generic V2 registry, and GitHub are present in the package, and another implementation for Azure Container Registry is present in the Docker extension itself.

One thing we wanted to call attention to--we decided the best place for the GitLab registry data provider to be is in its own extension, which does not yet exist. As a result, support for GitLab Container Registry is removed in Docker extension version 1.27.0. If you need that GitLab support, I would recommend staying on version 1.26.1 of the Docker extension. You can change by running the command "Extensions: Install Specific Version of Extension...", choosing the Docker extension, and choosing version 1.26.1.

@LordMilutin
Copy link

I don't know what you did but private registries are no longer visible for connection...
There is no way anymore to connect them. Please bring back this functionality as this was my only way to manage the registry with a nice UI...

@microsoft microsoft locked and limited conversation to collaborators Nov 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.