Skip to content

Allow for Dockerfile to be named something else#7995

Closed
duglin wants to merge 1 commit intomoby:masterfrom
duglin:RenameDockerfile
Closed

Allow for Dockerfile to be named something else#7995
duglin wants to merge 1 commit intomoby:masterfrom
duglin:RenameDockerfile

Conversation

@duglin
Copy link
Copy Markdown
Contributor

@duglin duglin commented Sep 11, 2014

This adds a '-d' option to the "docker build" command to allow you to specify the name of the Dockerfile to use.
e.g.
docker build -d dev.dock -t myapp .
docker build -d prod.dock -t myapp .
This is really handy when you have a docker context (dir tree) that is built multiple times/ways and the really only difference is the contents of the Dockerfile.

While I think its functionally complete, I haven't updated the docs (just the cli help text) nor added testcases yet - as those will probably be a bigger job than the actual code changes :-) . I plan to do both but only if the idea of this PR is acceptable to folks. If so, I'll then go back and finish the PR properly.

Comments?

Signed-off-by: Doug Davis <dug@us.ibm.com>
@jessfraz
Copy link
Copy Markdown
Contributor

Thanks for contributing @duglin. However, we do not plan on changing this at this time, much like a Makefile is named a Makefile we intend to keep the convention of Dockerfiles only being named Dockerfile.

@jessfraz jessfraz closed this Sep 11, 2014
@jessfraz
Copy link
Copy Markdown
Contributor

Also this issue was heavily debated and nothing came of it: #2112

@duglin
Copy link
Copy Markdown
Contributor Author

duglin commented Sep 11, 2014

@jfrazelle thanks for the feedback. Got a couple of follow-on questions:

  • make actually does allow you to specify the name of the Makefile (see -f option)
  • what is the preferred mechanism for having a single source/context tree that is built multiple ways? While I'm sure there are some fancy tricks that might be able to be played with lsymbolic-inks, none that I've seen are nearly as user-friendly as what 'make' allows for.

@jessfraz
Copy link
Copy Markdown
Contributor

@duglin I realized the option for the Makefile after I said it, it was a bad example, but if you look at the issue I linked you can see nothing really came from the discussion.

@duglin
Copy link
Copy Markdown
Contributor Author

duglin commented Sep 11, 2014

@jfrazelle yep, I've noticed a few issues that are related to this but I didn't notice anyone saying "heck no!" :-) it was more that the conversations just died - I assume due to the lack of a PR. So, maybe this can jump start it again. IMO this would be a pretty big usability improvement.

@jessfraz
Copy link
Copy Markdown
Contributor

You might find this of interest too: #7115

@duglin
Copy link
Copy Markdown
Contributor Author

duglin commented Sep 11, 2014

I remember coming across #7115 last night but I think they're addressing a different issue because in their usecases they're still starting with a single Dockerfile and pulling in other images. I'm looking to have multiple/different Dockerfiles that use the same src/context tree as its input. Unless I'm missing something I don't think their solution would solve my usecase.

Would it be inappropriate to reopen this issue so that people know they can/should comment on it? I'd prefer to have more of a discussion before we close it as I don't see a good alternative available to me with the current Docker features.

@tiborvass
Copy link
Copy Markdown
Contributor

@duglin Feel free to continue the conversation on #2112 by explaining your usecase and how it's different from what you've read so far on that long thread. Currently we try not to discuss high-level design (especially UI change) on PRs.

@duglin
Copy link
Copy Markdown
Contributor Author

duglin commented Sep 11, 2014

@tiborvass - ah didn't know discussions should be kept out of PRs, sorry - will move over to #2112

@jakehow
Copy link
Copy Markdown

jakehow commented Sep 11, 2014

@tiborvass and @jfrazelle if you guys read through the long thread, it gets some tentative support near the end by @shykes (#2112 (comment)), however, there has been no feedback from anyone @docker since then.

This is a very simple change with overwhelming support and seemingly no coherent argument against the change. If there is a coherent argument against it, no one on the team has put it together in words for the community to read and review.

You can see the high level proposal I made here (#7284), there may be others, which was in response to a request for the discussion to take that form from @shykes, I am not sure if this PR is a direct implementation of that idea yet, but will review shortly.

@jakehow
Copy link
Copy Markdown

jakehow commented Sep 11, 2014

@tiborvass @jfrazelle @duglin @shykes

OK, reviewed. This should be reopened, as it is an implementation of #7284 The only difference from the original proposal is the flag is currently called -d instead of -f

If there needs to be discussion around whether or not this is an acceptable Proposal, it can happen on #7284

If the process for Proposals has changed, at some point since between when this was started and now, please outline the correct process or point us to documentation so we can follow it.

@duglin
Copy link
Copy Markdown
Contributor Author

duglin commented Dec 17, 2014

See #9707 as the follow-on to this PR.

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.

4 participants