Comments (6)
Interested in opening a PR to make this work better?
from common.
Yes I can open one and at the same time I need to know what result you expect.
To compare docker
and podman
I have used ~/.docker/config.json
with:
{
"credHelpers": {
"foo.io": "pass"
}
}
Actual behavior:
With docker
:
$ docker-credential-pass list
{}
$ docker login foo.io # docker asks for username and password
Username: my_username
Password:
Login Succeeded # docker stores credential in pass database
$ docker-credential-pass list
{"foo.io":"my_username"}
$ docker login foo.io
Authenticating with existing credentials...
Login Succeeded
$ docker logout foo.io
Removing login credentials for foo.io # docker removes credential in pass database
$ docker-credential-pass list
{}
With podman
:
$ docker-credential-pass list
{}
$ podman login foo.io # podman asks for username and password
Username: my_username
Password:
Login Succeeded # podman stores credential in base64 in `/run/user/uid/containers/auth.json`
$ docker-credential-pass list
{}
$ podman logout foo.io
Removed login credentials for foo.io
$ docker-credential-pass store
{"ServerURL":"foo.io","Username":"my_username","Secret":"my_secret"}
$ docker-credential-pass list
{"foo.io":"my_username"}
$ podman login foo.io
Authenticating with existing credentials...
Existing credentials are valid. Already logged in to foo.io
$ podman logout foo.io
Not logged into foo.io with current tool. Existing credentials were established via docker login. Please use docker logout instead.
$ docker-credential-pass list
{"foo.io":"my_username"}
To sum up docker
stores the password in pass on login if not already present and delete the password in pass on logout while podman
retrieves credentials with pass if present and fallback to base64 if not and podman
never updates pass database.
Side note:
In my tests I had to specify export GPG_TTY=$(tty)
to be able to enter my passphrase with podman
because it starts a specific gpg-agent
and does not use the global one:
# before any podman commands that need access to registry
$ ps -fp "$(pgrep -d, -x gpg-agent)"
UID PID PPID C STIME TTY TIME CMD
my_username 4010 2420 0 08:39 ? 00:00:05 /usr/bin/gpg-agent --supervised
# after a podman command that needs access to registry
$ ps -fp "$(pgrep -d, -x gpg-agent)"
UID PID PPID C STIME TTY TIME CMD
my_username 4010 2420 0 08:39 ? 00:00:05 /usr/bin/gpg-agent --supervised
my_username 33240 2420 1 09:31 ? 00:00:00 gpg-agent --homedir /home/my_username/.gnupg --use-standard-socket --daemon
Proposal:
For me, docker/podman login/logout
should not be used when used with pass
(this assumes that people use a passphrase) or only as a simpler alternative to docker-credential-pass store/erase
.
Ideally it is not only messages that should change, I propose to:
- document that
login/logout
actually store and delete credentials and that they may not be necessary when the password is stored with pass - only use the credentials helper specified for a registry and triggers an error if not possible (ie no fallback)
- let
podman
use globalgpg-agent
and not a specific one - change
podman login/logout
(behavior and messages) to matchdocker
as you want to be compatible
from common.
Podman will not use the dockerfile location by default.
You need to either set DOCKER_HOST or use --auth-file to point at the config.
podman login --auth-file ~/.docker/config.json foo.io
from common.
Podman will not use the dockerfile location by default.
You mean to store credentials in the authentication file or to read authentication file? If the latter,
based on my tests and the code I would say that podman
fallbacks by default. Login() calls config.GetCredentials() that explicitly states:
GetCredentials returns the registry credentials stored in the
registry-specific credential helpers or in the default global credentials
helpers with falling back to using either auth.json
file or .docker/config.json, including support for OAuth2 and IdentityToken.
If an entry is not found, an empty struct is returned.
from common.
Are you seeing the expected behaviour?
from common.
I do not get it. If you talk about ~/.docker/config.json
yes podman
uses it as fallbacks, if you talk about the issue then no, there was no replies about my proposal.
from common.
Related Issues (20)
- [v0.52.x][git cherry-pick 5c81adc] apparmor: fix parsing beta/alpha version HOT 3
- [v0.53.x][git cherry-pick 5c81adc] apparmor: fix parsing beta/alpha version HOT 14
- Should pkg/retry retry on HTTP status 500? (502? others?) HOT 5
- Emit error when binary file not executable HOT 1
- Logo Visibility Issue in GitHub Dark Theme HOT 2
- Running without a uid 0 : write to `/proc/sys/net/ipv4/ping_group_range`: Invalid argument HOT 9
- Packit tasks w/ containers-common rpm HOT 2
- Inconsistent and underdocumented behavior when choosing a digest HOT 4
- Clearing `defaultNetworkBackend` file entry in case of networkBackend change HOT 1
- "inappropriate ioctl for device" with --password-stdin and an empty password HOT 2
- enable ginkgolinter and testifylint HOT 2
- podman manifest create with local images tries to access remote repository HOT 1
- Containers can no longer receive signals from crun HOT 1
- Should not try again with "slow" queryPackageVersion, after failing to find with "fast"
- Filter out copyright and license information from the version output HOT 2
- Set neutral locale (C) when running package manager or version commands HOT 2
- Add version filtering for the pacman package manager from arch
- Containerfile.5.md should document "magic" build-args HOT 2
- [seccomp] update defaults to current docker rules (Started as: block unshare by default) HOT 14
- v0.59 branch HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from common.