-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
extraDirectory doesn't work with symbolic links as either destination or source #1576
Comments
Hey @prashantpro. Thanks for bringing this up. The workaround for this is to just directly reference the target that the link is referencing. I image that would be annoying if you're swapping servers regularly but might be acceptable for a simple case. We currently have this low priority on our schedule, and given how jib works might consider not solving this. However if we get enough attention we can take another look. So please thumbs up this issue if it is seriously affecting you. |
Low priority is fine, I don't think this is a deal breaker. The ugliness (opinionated) of the issue is that I need to create multiple directories.
Here jib will correctly copy the desired configuration file to destination directory. |
I'm going to re-open this as there's a workaround but not a solution. If others encounter this issue, please describe your situation here. |
It took me a while to realize, that jib replaces the symbolic link. A hint at the section could be helpful. |
I tried to install busybox on top of another base image. But I could not create symbolic links for busybox aliases. I wonder if we can have similar features to the ones in Bazel rules_docker.
|
So there are two sides of the issue:
|
I have the similar case: extraDirectories with symlinked file in them - C++ binaries, which I have to run with my Java application. But JIB just put the copy of the file instead symlink. This increases the size of image significantly. |
I have to copy Python binaries. I have run the script from my Java application. Can somebody help if that can be done? If I am copying them it's failing with an error. couldn't follow symbolic link |
Description of the issue:
I have a maven project structure and have used the default jib location of extraDirectory.
src/main/jib/
Added my desired file i.e. 'server.xml' that needed to be placed under '/config' within the base image.
Thus, the structure now looked like this: (As jib requires recreating the structure under 'jib' directory)
src/main/jib/config/server.xml
The destination directory '/config' is actually a symbolic link in the base image.
After jib creates the image, on inspecting it can be seen that the symbolic link has now got replaced with an actual directory. Which breaks the build for me.
Expected behavior:
Symbolic link directories are typical in Java EE server images where these links are provided for deployment or configuration file placement.
Here the 'config' directory is the case for openliberty server.
Would expect this structure to be preserved if possible. Or provide some means of achieving the goal of putting files under images which use a symbolic link as a destination folder.
Environment:
Maven 3.5
Java 8
OS - MacOS
jib-maven-plugin
Configuration:Additional Information:
I inspected the image by logging into it with bash (running container). And I can see that the symbolic link 'config' within the server, now got changed to an actual directory.
Let me know if you need more details? This actually should be easily reproducible without requiring any Java or server technology, it's just a matter of how JIB copies the structure on the base image.
The text was updated successfully, but these errors were encountered: