Allow for Dockerfile to be named something else#7995
Allow for Dockerfile to be named something else#7995duglin wants to merge 1 commit intomoby:masterfrom
Conversation
Signed-off-by: Doug Davis <dug@us.ibm.com>
423e08c to
cc486f8
Compare
|
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. |
|
Also this issue was heavily debated and nothing came of it: #2112 |
|
@jfrazelle thanks for the feedback. Got a couple of follow-on questions:
|
|
@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. |
|
@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. |
|
You might find this of interest too: #7115 |
|
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 - ah didn't know discussions should be kept out of PRs, sorry - will move over to #2112 |
|
@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. |
|
@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. |
|
See #9707 as the follow-on to this PR. |
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?