Skip to content

New docker daemon command#13771

Merged
jessfraz merged 3 commits intomoby:masterfrom
tiborvass:daemon-cli
Jul 24, 2015
Merged

New docker daemon command#13771
jessfraz merged 3 commits intomoby:masterfrom
tiborvass:daemon-cli

Conversation

@tiborvass
Copy link
Contributor

Fixes #9677

This patch creates a new cli package that allows to combine both client
and daemon commands (there is only one daemon command: docker daemon).

The -d and --daemon top-level flags are deprecated and a special
message is added to prompt the user to use docker daemon.

Providing top-level daemon-specific flags for client commands result
in an error message prompting the user to use docker daemon.

This patch does not break any old but correct usages.

Signed-off-by: Tibor Vass tibor@docker.com

Thanks to @rhatdan and @shishir-a412ed for their huge patience and their initial work.

Ref #6055 #9255 #10535 #11418

@icecrime
Copy link
Contributor

icecrime commented Jun 5, 2015

Design was approved in the preceding PR, and it seems to be in line with the earlier discussions, so I suggest we directly go to code review.

@thaJeztah
Copy link
Member

ping @albers for reviewing completion scripts :-) ❤️

@tiborvass tiborvass force-pushed the daemon-cli branch 3 times, most recently from 4b1f64b to e03479c Compare June 9, 2015 20:48
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preceding three options are not boolean and should call _filedir

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know much about _filedir would you mind showing me a fix?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the completion for --pidfile|-p|--tlscacert|--tlscert|--tlskey) in _docker_daemon().
By the way. if you would prefer to concentrate on real coding stuff, I could take over the bash completion part. Just give me a ping.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--tlscacert|--tlscert|--tlskey should also be removed from _docker_daemon() as they are already treated globally in _docker_docker()

@albers
Copy link
Member

albers commented Jun 10, 2015

@thaJeztah I added some comments and I offer to take over the bash completion part. It's a bit more complex than usual and quite hacky.
I cannot comment on the zsh part because I'm not yet familiar with it.

@thaJeztah
Copy link
Member

Thanks so much @albers, I knew this was quite a big change, so happy to have you on board here!

@tiborvass what's the easiest way for @albers to carry the bash completion?

@tiborvass
Copy link
Contributor Author

@thaJeztah I can remove it or leave it as-is for now until we have some more review on the docker side of things.

@albers
Copy link
Member

albers commented Jun 11, 2015

I think it's better to remove the completion part here. It will leave the remaining part more focussed and my follow up PR more self-contained.
I will also address your addition of the zfs storage driver in another PR.

@thaJeztah
Copy link
Member

Thanks @albers!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dead code?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tiborvass can we remove this file?

@calavera
Copy link
Contributor

root@d# ./docker daemon
INFO[0000] [graphdriver] using prior storage driver "aufs"
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
WARN[0000] Running modprobe bridge nf_nat failed with message: , error: exit status 1
WARN[0000] Your kernel does not support swap memory limit.
INFO[0000] Loading containers: start.
............
INFO[0000] Loading containers: done.
INFO[0000] Daemon has completed initialization

😻 LGTM after a rebase 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does docker daemon -H=tcp://0.0.0.0:2375 also work?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from the technical aspect, IMHO the =argsyntax is confusing when used on a short option. It is very common for the long form options but I cannot recall having seen this elsewhere before.
I recommend using either -H tcp://0.0.0.0:2375 or --host=tcp://0.0.0.0:2375

@duglin
Copy link
Contributor

duglin commented Jun 18, 2015

rebase needed

@duglin
Copy link
Contributor

duglin commented Jun 18, 2015

and probably a squash

@tiborvass
Copy link
Contributor Author

@calavera that shows you're not testing this PR :)

$ DOCKER_CLIENTONLY=1 ./hack/make.sh binary
$ docker daemon -H 0.0.0.0:3456
docker: 'daemon' is not a docker command.
See 'docker --help'.

@calavera
Copy link
Contributor

oh, much better! thanks

@calavera
Copy link
Contributor

The new changes also LGTM

Shishir Mahajan and others added 2 commits July 23, 2015 20:31
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if its not an initErr ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then it moves on to if len(args) > 0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well yea, I got that. Just expected it to do something with it. I guess we'll deal with it at line 93.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@duglin
Copy link
Contributor

duglin commented Jul 24, 2015

way too much code to review :-) but it seems good. We can fix any bugs that pop-up later.
LGTM!

jessfraz pushed a commit that referenced this pull request Jul 24, 2015
@jessfraz jessfraz merged commit 7674f21 into moby:master Jul 24, 2015
@jessfraz
Copy link
Contributor

no going back now ;)

@shishir-a412ed
Copy link
Contributor

@tiborvass
👏 👏 👏 👏

@thaJeztah
Copy link
Member

Oh yes!!

I did a quick scan of the docs changes and the changes LGTM, I hope we got them all :-)

@thaJeztah
Copy link
Member

ping @albers - hope you are able to work on the completion scripts now 😄

@albers
Copy link
Member

albers commented Jul 24, 2015

It will take about one week until I can get back to it. I'm reopening #13934 to indicate that it's in progress.

@thaJeztah
Copy link
Member

Thanks for the heads-up, @albers!

@rhatdan
Copy link
Contributor

rhatdan commented Jul 24, 2015

Finally, this might have been one of the Oldest Patchsets/requests. Thanks.

@thaJeztah
Copy link
Member

Thank you @rhatdan, IIRC, you started this PR-relay originally 👍

@tiborvass tiborvass deleted the daemon-cli branch July 24, 2015 15:27
@albers
Copy link
Member

albers commented Jul 31, 2015

@sdurrheimer Hi Steve, docker -d was replaced by the new docker daemon command. Maybe you could add this to zsh completion?

@thaJeztah
Copy link
Member

Think we need the fish completions updated as well; I think those are auto-generated

gesellix added a commit to gesellix/boot2docker that referenced this pull request Aug 12, 2015
Replace the deprecated `-d` command line flag with the new command name `daemon`.
See moby/moby#13771 for details.
@tiborvass tiborvass removed their assignment Nov 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.