gradle-docker
gradle-docker copied to clipboard
external dockerfile Context is not as Expected
I believe I've described this problem correctly - feel free to contact if there are any questions:
Description of Problem:
When running a Docker
task using an external dockerfile 'dockerfile'
the context is changed from the external dockerfile's original context (for example, the root context of a project) to the context of a generated Dockerfile - typically build/docker
.
Expected Function:
When using an external Dockerfile my expectation was that the context would remain relative to the original dockerfile, not a copied dockerfile. This has the impact of causing ADD
and COPY
file to fail, given that the context is build/docker
which contains no built artifacts.
True, this is a bug. The plugin copies the external dockerfile so that it could be extended by instructions from the build script. However while copying it, the dockerfile's context should also be copied to the staging are in the build directory. Looking into it later today.
This one just bit me too. I guess I guess I cant use external dockerfiles until this is fixed.
+1
+1
+1
👍
+1 Is there any workaround, apart from copying the whole context to the temporary location of Dockerfile?
+1
Workaround for this issue : https://github.com/Transmode/gradle-docker/issues/90#issuecomment-850788232