Skip to content
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

Support jib "extra directories" feature #8936

Closed
michael-schnell opened this issue Apr 29, 2020 · 16 comments · Fixed by #10011
Closed

Support jib "extra directories" feature #8936

michael-schnell opened this issue Apr 29, 2020 · 16 comments · Fixed by #10011
Assignees
Labels
Milestone

Comments

@michael-schnell
Copy link
Contributor

There should be support for the extra directory feature of jib.

It is often necessary to have some extra files in the container image that are not part of the Java application. An example could be some kind of "wait" script or utility that allows the Quarkus app to wait for a database container to be available before the app is actually started. Currently this is not possible when using jib.

@michael-schnell michael-schnell added the kind/enhancement New feature or request label Apr 29, 2020
@quarkusbot
Copy link

/cc @geoand

@geoand
Copy link
Contributor

geoand commented Apr 29, 2020

I think it makes sense. I'll check it out soon.

@geoand
Copy link
Contributor

geoand commented Apr 29, 2020

Actually I think it makes sense to wait for a new jib-core release before adding this. The reason is that the API seems to have a change a bit, so better just use the newest stuff once it's released.

@michael-schnell
Copy link
Contributor Author

Release 0.14 & 0.15 of jib-core are available in the meantime.
Does it make sense to start with this issue?

@geoand
Copy link
Contributor

geoand commented Jun 13, 2020

Yeah, it's probably as time of a good time as any

@geoand geoand self-assigned this Jun 15, 2020
geoand added a commit to geoand/quarkus that referenced this issue Jun 15, 2020
@geoand
Copy link
Contributor

geoand commented Jun 15, 2020

#10011 should take care of this

geoand added a commit to geoand/quarkus that referenced this issue Jun 16, 2020
geoand added a commit that referenced this issue Jun 16, 2020
Support jib extra directories feature
@michael-schnell
Copy link
Contributor Author

Cool! Along with #8937 this will be a very nice feature to allow adding things like a wait script.

@geoand
Copy link
Contributor

geoand commented Jun 17, 2020

Right, I forgot about that one, thanks!

@ayhanap
Copy link

ayhanap commented Mar 16, 2023

I guess this just overrides the target directory. I am trying to copy files under /lib64 but it replaces the entire folder.

As I checked this is doable with the jib plugin. Is there a way I can use jib plugin alongside with Quarkus?

@geoand
Copy link
Contributor

geoand commented Mar 16, 2023

Is there a way I can use jib plugin alongside with Quarkus

Not really.

What exactly do you want to do that is not currently working?

@ayhanap
Copy link

ayhanap commented Mar 16, 2023

I am trying to add some libraries needed for AWT under /lib64 as mentioned https://quarkus.io/guides/quarkus-runtime-base-image#extending-the-image.

I extracted libraries from an image and placed them under /src/main/jib/lib64/libfreetype.so.6 and so on.

But this replaces the entire lib64 folder, leaving with an image without java, sh etc..

Right now I am trying to place these libraries on a temp folder and use a custom entrypoint.sh copying files to lib64 then running ./application. (using both native and regular images)

Edit: Posting as a reference. Ended up putting files to /src/main/jib//lib64-addition and creating a custom entrypoint.sh with the help of quarkus.jib.native-entrypoint=

#!/bin/bash
mv /lib64-addition/* /lib64
/work/application

@geoand
Copy link
Contributor

geoand commented Mar 17, 2023

@ayhanap Do you know if the jib maven plugin adds the files instead of replacing the entire directory?

@ayhanap
Copy link

ayhanap commented Mar 17, 2023

@geoand Docs and previous issues mention adding specific files but that's just a way to filter files to be copied etc.

I just set up a project and tried every option the jib plugin has and it has the same behavior.

Sorry for keeping you busy. I asked a question on google jib issues, will keep updated if there is a way to do it.

Right now I am good with the current workaround of moving files to destination folder with a custom entrypoint.sh

@geoand
Copy link
Contributor

geoand commented Mar 17, 2023

Thanks for checking.

If the jib maven plugin has this behavior, then I think we are good in Quarkus as well.

Right now I am good with the current workaround of moving files to destination folder with a custom entrypoint.sh

👍🏼

@ayhanap
Copy link

ayhanap commented Mar 17, 2023

Ok turns out the problem I am facing is because /lib64 is a symlink to /usr/lib64. I can confirm if I use the folder structure of /usr/lib64/* it copies the files successfully on jib plugin and quarkus too.

@geoand
Copy link
Contributor

geoand commented Mar 17, 2023

Cool, that information will certainly be useful to others

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants