gradle-docker icon indicating copy to clipboard operation
gradle-docker copied to clipboard

external dockerfile Context is not as Expected

Open colinbjohnson opened this issue 10 years ago • 9 comments

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.

colinbjohnson avatar Oct 19 '14 20:10 colinbjohnson

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.

mattgruter avatar Oct 20 '14 07:10 mattgruter

This one just bit me too. I guess I guess I cant use external dockerfiles until this is fixed.

wgorder avatar Dec 19 '14 16:12 wgorder

+1

frankscholten avatar Mar 30 '15 11:03 frankscholten

+1

mlucchini avatar Nov 19 '15 16:11 mlucchini

+1

ikennedy avatar Mar 14 '16 00:03 ikennedy

👍

alan-czajkowski avatar Jun 07 '16 15:06 alan-czajkowski

+1 Is there any workaround, apart from copying the whole context to the temporary location of Dockerfile?

JulianSchuette avatar Jul 19 '16 17:07 JulianSchuette

+1

arvindkumarc avatar Oct 08 '17 08:10 arvindkumarc

Workaround for this issue : https://github.com/Transmode/gradle-docker/issues/90#issuecomment-850788232

abhishek-mvr avatar May 29 '21 07:05 abhishek-mvr