-
Notifications
You must be signed in to change notification settings - Fork 642
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
targetDir in assembly not working #634
Comments
I ran into this as well, and tracked it down to
If a DockerFile is not specified, the directory is renamed when tarring the build context, see
However, if a DockerFile is specified, a DockerFileBuilder is not created, and the renaming does not occur, leaving the assembly in the wrong place. I wonder why the plugin does not put the assembly into the correct directory to begin with?
|
The issue still exists in d-m-p 0.20.0. pom.xml
The resulting targetDir is always This targetDir has to be referenced in the Dockerfile and impairs the portability of it. And we use a Dockerfile in the first place to have more freedom and be independent from maven. |
also verified this issue exists in latest release when using a Dockerfile |
Actual it's true that for the However, as you have to add the assembly yourself in the Dockerfile anyway with ADD or COPY it shouldn't be the big deal. So you have to add something like
if you want to have this behaviour. Actual As it says in the documentation:
Agreed, this should be more clear as its a bit confusing, I will add to it. @mbacodes @bedag-moo @Madanor @paulwilton : Considering that this |
Yes I think it is - it just seems a bit odd to have the Dockerfile using a 'maven' path in it, when we have separated the Dockerfile out specifically to decouple it from Maven |
@paulwilton well, at the end you still refer to a Maven assembly with is configured within Maven. tbh, this was first used as an internal directory, before the Dockerfile support went in. Maybe it's a good idea to make it configurable so that we could choose a different default (and people could use the config variable to keep their setup). This makes sense also because we support a docker:source goal, which exports the content of the whole context directory (including the Dockerfile). So it's also visible to the outside. Let me add this and also clarify the documentation more on this topic. |
Yes. It would be great to be able to configure the target path (or source path in the Dockerfile). We'd like to be able to use the Dockerfile with and without Maven. While it works at the moment( |
Personally, my complaint is that the documentation seems to imply that targetDir matters, but the code ignores it. This caused a nice debugging session on my end :-( I don't mind whether you change the documentation or the code as long as the two agree :-) |
@bedag-moo sorry for the bad experience ;-( I completely agree that the documentation at this point is quite thin. The documentation will be changed this week along with a new version. that is the plan. Thanks for the feedback! |
this can be used to specify the assembly name which is used also as directory for holding the assembly files. I.e. the directory which needs to be refered to when an extrean Dockerfile wants to include an assembly. "targetDir" now defaults to "/" + this name. Also extended the documentation to clarify the usage. Fixes fabric8io#634
@mbacodes @bedag-moo @Madanor @paulwilton : I added now a new option "name" to the assembly config which allows you to specify the original source directory. Also worked on the docs Is this understandable or should I add still some more explanations ? |
Just merged in to master. Happy to pickup still any feedback here. |
@rhuss That looks good to me. Thank you. |
this can be used to specify the assembly name which is used also as directory for holding the assembly files. I.e. the directory which needs to be refered to when an extrean Dockerfile wants to include an assembly. "targetDir" now defaults to "/" + this name. Also extended the documentation to clarify the usage. Fixes fabric8io#634
Description
When trying to set a custom
targetDir
in the assembly section like described int the docu, it's getting ignored and/maven
is used.Info
mvn -v
) :git@github.com:mbacodes/docker-maven-plugin-test.git
Setting
<targetDir>/foo</targetDir>
does not change anything.The resulting
targetDir
still istarget/docker/test/hello-world/latest/build/maven
The text was updated successfully, but these errors were encountered: