-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow different location for Dockerfile #46
Comments
Please try version gradle-docker-plugin/src/test/groovy/de/gesellix/gradle/docker/tasks/DockerBuildTaskSpec.groovy Line 118 in 581badb
[rm:true] is the default, so don't forget to add it when playing around with the [dockerfile:'...'] . Another detail: the referenced Dockerfile needs to be contained in the build context, which effectively means that you have to configure a path relative to the build context root, but not starting with ../ .
The current implementation is obviously the least convenient way, but it's a start ;-) Could you describe the use case for the secondary goal? I personally prefer version controlled Dockerfiles instead of generated/templated ones. But let's discuss details in a dedicated issue. |
Great, that's a good start. I think having the flexibility in there allows the script author to manipulate things at a lower level when the plugin does not offer support at DSL level. Obviously I would still like to see the support at high-level, but I can at least play around with it at this level. As to the secondary case:
|
This was a great idea. It makes building containers a lot easier. (No need for an instance of a |
It's the official Docker client's default - it only has an effect on the intermediate containers which are created during the build of each layer, see the docs for all details. |
Lets keep this issue opened for a more convenient way of building images from a custom Dockerfile and add a new issue for the templated/generated Dockerfile. Would you like to add another issue, by describing some kind of desired example task? A bit late for Christmas presents, but you may tell me your wishes ;-) |
I'll take care of that. |
Primary: The docker cmdline allows for
-f
to have the Dockerfile at a location other than the context directory. Similar functionality would be very very useful in the plugin as it allows forDockerfile
to be static and then thebuildContextDirectory
to reside inbuildDir
.Secondary: The above functionality will then also allow for an auto-generated Dockerfile to be used. Some of the other plugins allows for the specificiation of a template that can be converted into a Dockerfile. Currently this can already be achieved in this plugin via a custom
Copy
task in a build script i.e.Given the above example and if the
DockerBuildTask
supports adockerFile
property then one would even be able to do something likeP.S. One could actually create a new task type i.e.
CreateDockerFileTask
, but I'll raise another issue for that case.The text was updated successfully, but these errors were encountered: