GoogleContainerTools / GoogleContainerTools/jib
extraDirectory doesn't work with symbolic links as either destination or source
- Dominant language
- Java
- Stars
- 14.5k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
**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**:
```xml
com.google.cloud.tools
jib-maven-plugin
1.0.2
openliberty/open-liberty:javaee8-java8-openj9
demo-project:1.0
/apps/
```
**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.
Contributor guide
Assessment
This issue has not been assessed yet.