extraDirectory doesn't work with symbolic links as either destination or source
See original GitHub issueDescription 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:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>1.0.2</version>
<configuration>
<from>
<image>openliberty/open-liberty:javaee8-java8-openj9</image>
</from>
<to>
<image>demo-project:1.0</image>
</to>
<container>
<appRoot>/apps/</appRoot>
</container>
</configuration>
</plugin>
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.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
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.
So there are two sides of the issue:
<extraDirectories>
): this is tough to support. We may need to list file contents of base image layers, statically analyze symlinks, and put files in correct destination directories.