-
Notifications
You must be signed in to change notification settings - Fork 779
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
auth file logic should match podman's #823
Comments
From a quick look, the auth file logic is actually very thin in Podman; the difference is that Podman somehow decides to set $XDG_RUNTIME_DIR to non-default values (that c/image doesn’t currently replicate because that logic is intricately linked with creating that directory in Podman). I do agree that |
After containers/podman#4337 Podman no longer depends on XDG_RUNTIME_DIR, and with #865 both Podman and Skopeo use the same defaults — and containers/podman#5265 tests that. So, this should be fine now; please reopen if that’s not the case. |
I don't have privs to reopen on this repo, but I believe this is not fixed Setup: rootless user (fedora, uid 1000) on a virt with $ skopeo copy containers-storage:quay.io/libpod/testimage:20210427 docker://localhost:5000/foo
FATA[0000] Error initializing destination docker://localhost:5000/foo:latest: error getting username and password: 1 error occurred:
* error reading JSON file "/run/containers/0/auth.json": open /run/containers/0/auth.json: permission denied
ERRO[0000] exit status 1 There are no XDG environment variables set. Note that skopeo is defaulting to skopeo-1.2.3-1.fc34 |
Reopening to investigate. |
A friendly reminder that this issue had no activity for 30 days. |
Yeah; I don’t know what I was looking at in the “this should be fine now” comment. It’s true that Podman usually doesn’t set There are multiple aspects to this:
|
Related: #1240 (comment) Podman is falling back to |
If this is referring to the line
note the credential helper wording: it’s not a file name, (Compare containers/podman#10068 which produces a non-debug end-user-targeted message.) |
So I poked around in the podman vs skopeo code. The best I can conclude is the behavior comes from differences in setup of the In any case, bottom-line: I think it would be okay solution for skopeo to fall back to using a non-shared file, like In other words, IMHO it's less important that skopeo, buildah, and podman somehow coordinate shared auth-file access, and more important they be as minimally functional to the user as possible given the constrained environment context. |
I think that’s a very reasonable RFE (by which I mean “absolutely worth considering”, not “yes”), but it’s not this RFE. Please file that as a c/image issue to consider changing the |
Are you sure this is coming from |
Skopeo is using the API as originally envisioned and doesn’t override the defaults and doesn’t have its own private (OTOH it is possible that we end up concluding that c/image should continue to have the root-only |
Right, okay I think I follow. Also moving the |
Podman and Buildah are using contaers/common/pkg/auth. I think the easiest solution would be to get skopeo to use this, and then look back porting this functionality into containers/image if it wants to go that way. I don't think containers/image should hard code a directory that only root can use. |
By my reading, skopeo is doing it that way too, but the setup of options passed in to
Ya, I think we're all in agreement on that one. |
The part of Podman that unconditionally sets XDG_RUNTIME_DIR, and potentially creates it in |
IIRC (it's been a loooooong time, memory is fuzzy), podman has very good reasons for guaranteeing XDG_RUNTIME_DIR is set, and buildah also. I my mind, this might be reason for simply overriding the defaults in skopeo, instead of fussing with c/common + the world. Reason being, it's one PR instead of many (four?), so fixing a long-standing issue quickly (albeit less ideal). That said, I'll still open an RFE for c/common since the default is definitely bad in any case. |
A friendly reminder that this issue had no activity for 30 days. |
- the "podman {run,exec} /etc" test: runc now spits out "is a directory" instead of "permission denied". And, on exec, exits 255 instead of 126. Deal with it. - workaround for containers/skopeo#823 (skopeo XDG bug): always make sure XDG is defined for skopeo Signed-off-by: Ed Santiago <santiago@redhat.com>
- the "podman {run,exec} /etc" test: runc now spits out "is a directory" instead of "permission denied". And, on exec, exits 255 instead of 126. Deal with it. - workaround for containers/skopeo#823 (skopeo XDG bug): always make sure XDG is defined for skopeo Signed-off-by: Ed Santiago <santiago@redhat.com>
podman has arcane rules for figuring out a path to a registry auth file; skopeo should probably share those rules.
Currently, credentials sharing breaks on rootless if
$XDG_RUNTIME_DIR
is not set:Tested with
enablelinger
both disabled and enabled, in which cases podman puts the auth.json file under/var/tmp/run-1000/containers
and/run/user/1000/containers
respectively. Skopeo does not see either one.[ Related to #822 but IIUC the code logic is in separate places ]
The text was updated successfully, but these errors were encountered: