You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR: When parsing docker config.json, rules_oci should strip off everything after the hostname (or, if not, add a caveat to the documentation).
I spent more time than I'd care to admit tracking down a problem using oci_pull with a private Quay repository. The problem turned out to be that my $HOME/.docker/config.json file looked like this:
It turned out that the "hostname" was quay.io/v2 for the purposes of matching which credentials, which of course did not match quay.io that was one of the pre-configured patterns. Therefore the credentials were not being passed along and I was getting a 401 error trying to get the token.
My docker config file as shown above was working for oci_push in version 1.x at least.
After debugging I ultimately discovered that removing the /v2 from the Quay URL solved my problem.
TL;DR: When parsing docker config.json,
rules_oci
should strip off everything after the hostname (or, if not, add a caveat to the documentation).I spent more time than I'd care to admit tracking down a problem using
oci_pull
with a private Quay repository. The problem turned out to be that my$HOME/.docker/config.json
file looked like this:It turned out that the "hostname" was
quay.io/v2
for the purposes of matching which credentials, which of course did not matchquay.io
that was one of the pre-configured patterns. Therefore the credentials were not being passed along and I was getting a 401 error trying to get the token.My docker config file as shown above was working for
oci_push
in version 1.x at least.After debugging I ultimately discovered that removing the
/v2
from the Quay URL solved my problem.I am happy to make a contribution to solve this, and this contribution seems really easy, but I am wanting to ask for guidance first:
_strip_host
to strip off/v2
too, or/v\d+
, or anything after a slash?_get_auth
that credentials were found forquay.io/v2
but notquay.io
(in my case), so the user has a hint where to look?Thanks in advance!
The text was updated successfully, but these errors were encountered: