Skip to content

added docker login command to login to docker registry#84

Merged
shykes merged 11 commits intomoby:masterfrom
kencochrane:users
Mar 16, 2013
Merged

added docker login command to login to docker registry#84
shykes merged 11 commits intomoby:masterfrom
kencochrane:users

Conversation

@kencochrane
Copy link
Copy Markdown
Contributor

Added a new docker login command that will allow register/login to the docker registry and cache the values locally for future use.

@shykes
Copy link
Copy Markdown
Contributor

shykes commented Mar 15, 2013

All the tests pass. As discussed @kencochrane I'll wait for confirmation that real-world usage works for a couple people other than you and me.

Let me know!

@chooper
Copy link
Copy Markdown
Contributor

chooper commented Mar 15, 2013

I gave it a shot. Two issues...

The first one is minor: docker help login actually invokes CmdLogin and doesn't return any help information. Try adding the following to the top:

if err := cmd.Parse(args); err != nil {
    return nil
}

With the second one, I was able to reproduce Solomon's issues, with a little more detail:

$ docker login # First time ...
...
$ docker login # Enter at prompt...
Error: Registration: 
$ docker login # Enter at prompt...
Error : use of closed network connection

I did some testing with strace -f -s 1024 docker login and found that:

  • When you receive Error : Registration:, it happens when the server returns an HTTP 400
  • When you receive Error : use of closed network connection, the server has returned an HTTP 200

@chooper
Copy link
Copy Markdown
Contributor

chooper commented Mar 15, 2013

More information about the Error : use of closed network connection error... when this happens, it appears as if the read is cut short (or maybe the write is, I can't tell). Here is the actual system call (which is actually multiple read() calls, formatted for readability:

[pid  4247] read(51, "
    HTTP/1.1 200 OK\r\n
    server: gunicorn/0.17.2\r\n
    date: Fri, 15 Mar 2013 06:40:55 GMT\r\n
    connection: close\r\n
    expires: -1\r\n
    content-type: text/plain\r\n
    pragma: no-cache\r\n
    cache-control: no-cache\r\n
    content-length: 2\r\n
    \r\n", 4096) = 201

And here's a response from a Login succeeded message:

[pid  4342] read(51, "
    HTTP/1.1 200 OK\r\n
    server: gunicorn/0.17.2\r\n
    date: Fri, 15 Mar 2013 06:41:24 GMT\r\n
    connection: close\r\n
    expires: -1\r\n
    content-type: text/plain\r\n
    pragma: no-cache\r\n
    cache-control: no-cache\r\n
    content-length: 2\r\n
    \r\n
    ok", 4096) = 203

At first glance they look very similar, but in the error case, the body of "ok" is never received.

@creack
Copy link
Copy Markdown
Contributor

creack commented Mar 15, 2013

I gave it a shot:

  • Minor issues:
    • We can create an account with an empty password
  • Improvements:
    • Hide the password while we type it

Otherwise, it looks good (beside the issues cited by Charles which are very annoying)

@kencochrane
Copy link
Copy Markdown
Contributor Author

I fixed the issue with no password, and the help message

@shykes
Copy link
Copy Markdown
Contributor

shykes commented Mar 15, 2013

Any problems left?

@kencochrane
Copy link
Copy Markdown
Contributor Author

We were able to reproduce, it was actually a server issue not a client issue. We are changing the server to fix. this should be good to merge.

@samalba
Copy link
Copy Markdown
Contributor

samalba commented Mar 15, 2013

Replaced the server by uwsgi. Ready to be retried!

shykes pushed a commit that referenced this pull request Mar 16, 2013
added docker login command to login to docker registry
@shykes shykes merged commit b55e461 into moby:master Mar 16, 2013
@ssadams11 ssadams11 mentioned this pull request Jul 10, 2015
runcom added a commit to runcom/docker that referenced this pull request Mar 23, 2016
BACKPORT: Fix for --cgroup-parent in docker
tonistiigi pushed a commit to tonistiigi/docker that referenced this pull request Nov 21, 2018
[18.09 backport] overlay2: use index=off if possible (fix EBUSY on mount)
ndeloof pushed a commit to ndeloof/docker that referenced this pull request Sep 13, 2022
crazy-max pushed a commit to crazy-max/moby that referenced this pull request Sep 29, 2022
thaJeztah pushed a commit to thaJeztah/docker that referenced this pull request Jun 26, 2023
Cherry-pick 871e8ff3e35f24e67241a96dac19710932c318fc into master (Synchronize boltbd libkv apis)
thaJeztah pushed a commit to thaJeztah/docker that referenced this pull request Jun 26, 2023
Cherry-pick 2b31300cef639e8c54aaaf52a6f57d1cf11883a3 into master (Synchronize boltbd libkv apis)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants