-
Notifications
You must be signed in to change notification settings - Fork 252
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
Publishing features to other registries than ghcr.io #322
Comments
Hi @aacebedo 👋 Does @joshspicer could you help correct my statement if I'm missing something. |
There's at least one issue asking them to support it, so I don't think they implement the distribution spec. That said, I'm currently not able to publish to a private azure registry, although it appears that it should be possible to (I get the same error as for gitlab, so maybe not). |
More concretely, what's failing is attempts to get login tokens to check for versions before publish (but after build/test/package). As near as I'm aware, there's no documentation around what's required to be able to upload to private/secured registries - and that you might need different credentials to do so (for instance if you have 2FA enabled, you likely need a credential helper to manage a token). The cli is trying to get a token from
|
@aacebedo - Yes, the registry needs to support the distribution spec (some registries are listed here: https://oras.land/implementors). Note that we only auto-detect the GITHUB_TOKEN for auth at the moment (work to I recently merged a PR that exercises the CLI against the reference We have an undocumented mechanism to auth against other registries with an environment variable cli/src/spec-configuration/containerCollectionsOCI.ts Lines 262 to 270 in fd4de3f
We have an open work item to read in the local |
@Clockwork-Muse yea, the I am actively working on this area, and would love more feedback if you give the latest changes a try. |
I also ran into this, though it was on the pull side when trying to retrieve a ghcr feature through a proxy registry in Artifactory. Artifactory's token endpoint was at a different location than what the CLI constructed. I was able to use the proxy in Artifactory with the From what I've seen (and is echoed in OCI spec issues 338,240,338), the OCI spec doesn't talk about authorization past saying it may be used, and, if so, here's what error codes to expect. Docker's registry V2 API is more opinionated and has a specification which speaks more to how authorization should be implemented. The flow they describe (and is supported by Artifactory and ghcr so may be more of a de facto standard) is to contact the registry first and, if a 401 response with a I'm thinking that might be the approach to take here. There could be some handling built in to go and get a token if we need one while referencing the environment variables if we know the token endpoint is going to require its own authentication, but the default path should probably be to try and get the artifact and, if we get back a 401 challenge, try to get a token from the value in its realm and then re-try the request. |
Thanks for the links @lmtthws I will investigate this. |
This PR addresses some of this: With this PR I can successfully use a feature hosted in Azure Container Registry (at least in my local client), I'm using https://github.com/dev-wasm/dev-wasm-feature/blob/main/.github/workflows/release.yaml |
The specification that @lmtthws and others shared has now been implemented in version Keep in mind that only registries implementing the distribution spec outlined here will work for Dev Container Features/Templates Please let me know if there are other improvements that can be made to the implementation |
Thanks ! I'll check this when gitlab finishes to implement the spec. I am watching their ticket on this subject. |
Great job |
Hi
I tried to publish a feature to a private repo on another package registry (gitlab) and it failed.
Seems that identification token is only handled for GH registries.
Is it confirmed? Is there some way to do this?
The text was updated successfully, but these errors were encountered: