Skip to content

Add docker daemon command instead of -d #6055

Closed
rhatdan wants to merge 1 commit intomoby:masterfrom
rhatdan:options
Closed

Add docker daemon command instead of -d #6055
rhatdan wants to merge 1 commit intomoby:masterfrom
rhatdan:options

Conversation

@rhatdan
Copy link
Copy Markdown
Contributor

@rhatdan rhatdan commented May 27, 2014

QE Reports that you can put lots of bogus options on the cli before the command
which are ignored if you specify a command. We should report a usage error
if a user does this.

I believe a better long term solution would be to remove the -d options and add a daemon command. This would make the handling of options the same for all use
cases.

Docker-DCO-1.1-Signed-off-by: Dan Walsh dwalsh@redhat.com (github: rhatdan)

@tianon
Copy link
Copy Markdown
Member

tianon commented May 27, 2014

This solution seems very error prone to me.

@tiborvass
Copy link
Copy Markdown
Contributor

What should happen when you specify an option to be a default one, like -G docker ?

@rhatdan
Copy link
Copy Markdown
Contributor Author

rhatdan commented May 27, 2014

tianon I agree which is why I suggested we drop -d and force the command to be daemon

docker daemon [OPTIONS]
docker run [OPTIONS]

Then you would not allow options before the command.

What should happen when you specify an option to be a default one, like -G docker ?

All I can check now is if the default changed, which tells me they used the option.

@vieux
Copy link
Copy Markdown
Contributor

vieux commented May 27, 2014

I think we should do multiple parse.

One to parse only --daemon and common options (like -H or -D)
and after do one parse for daemon only.

@tianon
Copy link
Copy Markdown
Member

tianon commented May 27, 2014

@vieux that sounds like an excellent halfway point while we wait for docker daemon to become a real command :)

(which, last time we discussed, was expected to come as soon as upstream Go managed to get us a reliable method of actual daemonization/backgrounding)

@rhatdan
Copy link
Copy Markdown
Contributor Author

rhatdan commented May 27, 2014

But that is just a complication of not using the command daemon. We have a few weeks to simpify the code, then you are stuck with it forever.

@rhatdan
Copy link
Copy Markdown
Contributor Author

rhatdan commented May 27, 2014

Why can't we do "docker daemon" now?

@cyphar
Copy link
Copy Markdown
Contributor

cyphar commented May 28, 2014

+1 for docker daemon. If we rewrite the code for the general flags, it will be mostly wasted effort since we'd need to migrate the daemon-related flags to CmdDaemon anyway.

@crosbymichael crosbymichael changed the title Do not allow users to specify daemon options along with commands Add docker daemon command instead of -d May 30, 2014
@crosbymichael
Copy link
Copy Markdown
Contributor

I changed the title of this PR

@rhatdan
Copy link
Copy Markdown
Contributor Author

rhatdan commented Jun 27, 2014

I have updated this pull request to substitute -d and --daemon with daemon command before flag.Parse()

This means existing installs will continue to work, but print a log message if they use -d or --daemon.

@cyphar
Copy link
Copy Markdown
Contributor

cyphar commented Jun 28, 2014

@rhatdan: can you put a deprecated notice, so that we can remove any mention of -d in 1.0.2 or 1.1.0?

@rhatdan
Copy link
Copy Markdown
Contributor Author

rhatdan commented Jun 28, 2014

I can change the log message to say that -d/--daemon is depracated and will be removed in a future release.

@SvenDowideit
Copy link
Copy Markdown
Contributor

+1 to the change, however, you still need to update cli.md and presumably there are other docs that mention it - oh there'll be a stack of distro/stuff to ping.

@tianon
Copy link
Copy Markdown
Member

tianon commented Jun 30, 2014

Most of those distro pings are directly in contrib/init in our repo. ;)

@rhatdan
Copy link
Copy Markdown
Contributor Author

rhatdan commented Jul 1, 2014

Fixed up contrib/init and cli.md

@tianon
Copy link
Copy Markdown
Member

tianon commented Jul 1, 2014

👍 contrib LGTM

@SvenDowideit
Copy link
Copy Markdown
Contributor

Docs LGTM, 🎉

@SvenDowideit
Copy link
Copy Markdown
Contributor

@jamtur01 @ostezer @fredlf

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The Docker daemon is usually...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MTU

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

container's

@jamtur01
Copy link
Copy Markdown
Contributor

jamtur01 commented Jul 1, 2014

Comments on commit.

@tiborvass
Copy link
Copy Markdown
Contributor

@crosbymichael @vieux do you guys want this? I do.

@vieux
Copy link
Copy Markdown
Contributor

vieux commented Sep 24, 2014

Not really, I'm not against as long as we keep -d

@bfirsh
Copy link
Copy Markdown
Contributor

bfirsh commented Sep 24, 2014

Makes a lot of sense to me. It clearly separates out the concerns of client and server.

@rhatdan
Copy link
Copy Markdown
Contributor Author

rhatdan commented Sep 24, 2014

I can work it again, if it has a chance of upstreaming.

QE Reports that you can put lots of bogus options on the cli before the command
which are ignored if you specify a command. We should report a usage error
if a user does this.

I believe a better long term solution would be to remove the -d options and add a daemon command.
This would make the handling of options the same for all use cases.

This patch will still handle the -d option by substituting "daemon" command and print a warning
message to the user.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
@SvenDowideit
Copy link
Copy Markdown
Contributor

I would loooove to deprecate docker -d :)

@rhatdan
Copy link
Copy Markdown
Contributor Author

rhatdan commented Oct 7, 2014

I have asked a couple of new guys coming to my team to look into it, unless someone else is working on it. I took a quick look and my original patches are way out of data at this point.

Although all of the docs stuff is still good. :^(

@petejkim
Copy link
Copy Markdown

petejkim commented Oct 8, 2014

i am seeing merge conflicts in the code?

@rhatdan
Copy link
Copy Markdown
Contributor Author

rhatdan commented Oct 8, 2014

Yes this patch set needs to be rewritten. The patch no longer applies. I don't have time to rework it now, but am trying to get others to do it. If you want to take a stab, go for it.

@crosbymichael
Copy link
Copy Markdown
Contributor

Ok, since this is not able to be merged and it's not exactly clear whether this is something that we should have in docker it maybe better to discuss this in an issue before rebasing and rewriting this PR. Sorry for the long response.

@rhatdan
Copy link
Copy Markdown
Contributor Author

rhatdan commented Oct 20, 2014

Well I think it is something we should definitely be in docker. I just don't have the time to rewrite the patch set. The current split causes man pages and option handling to be buggy and not easy to understand when to use certain options. IE A lot of options are only valid for use with the -d option. Changing this to daemon would clear this up.

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.

10 participants