extraDirectory should maintain same project structure
See original GitHub issueDescription of the issue:
Currently, when using <extraDirectories>
, it dumps all files in the specific directory into the root of the docker container.
Expected behavior:
Similar to while using src/main/jib/...
, <extraDirectories>
should just use the directory structure when copying it into the docker container.
Environment: Maven
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
How to maintain same folder structure in github with git ...
I want to track my project folder and its subfolder with node modules together with git add . But it seems I can't...
Read more >3094 – Extra directory created under ide-beta (1GHJBG2)
4. After installation, I go into '/opt/vame1.4/ide-beta' and execute './vame'. An 'opt' directory appears under 'ide-beta' containing a skeleton of the normal ...
Read more >git - It is good practice for each project (within a directory) to be ...
So I have two questions: Is it a good idea to split each project out into its own repository? (If so, will this...
Read more >Good Integration Practices — pytest documentation
Putting tests into an extra directory outside your actual application code might be useful if you have many functional tests or for other...
Read more >Can someone please explain to me the rational for shoving > your ...
... (which are environment-specific and fragile), and (3) you are not maintaining an extra directory structure which could diverge by accident.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I might understand. Jib just takes the contents of the directory you specify and moves it to the root directory in the image, which is intended. To get the files where you need them to go, you need to setup the exact intended destination directory structure within your extra directory.
If you want your secret files to be in
/.build/secrets/decrypted
on your container, for example, then you would need to configure your extra directory, and have the extra directory itself contain.build/secrets/decrypted/...
.E.g. configure
<extraDirectories><paths>${project.basedir}/secretsDir</paths></extraDirectories>
then put your secret files in<project dir>/secretsDir/.build/secrets/decrypted/...
to get your files in/.build/secrets/decrypted/
on your image.But I think I can see why you might not want to do this, if the
.build
directory contains other files that you don’t want to add to the container, and you only want to add those secret files, but you don’t want to add them to/
. Extra layers in Jib is still an incubating feature, though, so if the current design doesn’t match your use case and you have any suggestions for how you’d like it to work, feel free to let us know.Let me know if this does/doesn’t make sense, or if I’m misinterpreting the problem!
Hey @TadCordle. I have a single module Maven project and the following is the Jib plugin configuration within my
pom.xml
:I’m trying to mount some secret files from
.build/secrets/decrypted
but when the image is created, I canexec
into the container and see the expected files in the root (/
) directory.Let me know if there is anything else that I can provide or I am doing something wrong!