jib: executable permission is never set
Description of the issue:
If you add a executable file to src/main/resources or src/main/jib the resulting docker image will include the files only with mode 0644.
Expected behavior:
The files should have a mode of 0744
Additional Information:
Creates a new TarArchiveEntry for each File. The TarArchiveEntry will always use TarArchiveEntry. DEFAULT_FILE_MODE for all files (0100644).
A possible change could be something like this:
if(java.nio.file.Files.isExecutable(sourceFile))
tarArchiveEntry.setMode(tarArchiveEntry.getMode() | 0100);
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (13 by maintainers)
@danielpetisme Thanks for the suggestion! That syntax looks nice, though we are trying to limit new configuration objects to reduce the keep at a minimum the complexity of Jib’s configuration.
Based on your proposal, we came up with the following that changes the existing
extraDirectoryconfiguration to include permissions:Thoughts? @GoogleContainerTools/java-tools
Hi @tbutter, @danielpetisme, @mfriedenhagen, we’ve released version
0.10.0with the ability to explicitly set file permissions on extra files. See documentation for Maven or Gradle.I 👍 this issue. I’ve integrated jib into jhipster generator and I must use a custom
entrypoint.sh. This file is stored undersrc/main/jiband set as executable but once copied on the container image, the file is not executable anymore. This problem forces me to run a dirctychmod +xbefore running the script 😢 It’s not a blocking point but its a pitfall we could avoid.I don’t how I could help?