-
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
executable permission is never set #794
Comments
We will most likely implement this fix by reading the file permissions set in |
|
Generally speaking, this is not true. For example,
|
And it's not uncommon to have the umask of |
@tbutter After some discussions, we thought that since the entrypoint executable is the Java application, if your application needs to execute other files, it should set the executable bit for those files first. Is there any use case that this would not work for? |
@coollog I think that is always possible, but in my understanding this is an expensive operation. Wouldn't it create a copy of the whole executable in the container instead of using the version from the image? |
@tbutter Yes, that is correct. I've added the discuss label for further discussions about the best approach here, since just checking for executable bit is not a solution that can guarantee reproducibility (and also doesn't apply to Windows). If you don't mind answering, could you provide more details as to your use case (such as what the executable is intended for)? |
One of the executables is ffmpeg (about 50MB) which is used to reencode a video thats generated in a Java application. |
@coollog One approach could be to explicitly list executable files in the gradle/maven configuration. That would be some manual effort but still less than setting the executable flag in Java. |
I 👍 this issue. I don't how I could help? |
Hi @danielpetisme , thanks for the input! We currently have two methods we're considering for resolving this issue:
@GoogleContainerTools/java-tools |
I assume that only files coming from the Reading the permission would be the more 'native/naive' way to propagate permissions I like the declarative approach with I would rather extend the
WDYT? |
Explicitly invoke the shell? |
Regarding #794 (comment), the default base image |
Specifying permissions in a pom/buildscript seems a bit icky. And sadly it's not very Mavenish to have XML attributes (though I think it can be done by accessing the An alternative could be to allow specifying a tar file and extract and preserve its permissions? |
I think picking up the permissions from the source directory would be good. Altering permissions lateron even in an |
@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 <extraDirectories>
<paths>(defaults to src/main/jib)</paths>
<permissions>
<permission>
<file>/file/in/container</file>
<mode>755</mode>
</permission>
</permissions>
</extraDirectories> Thoughts? @GoogleContainerTools/java-tools |
Hi @tbutter, @danielpetisme, @mfriedenhagen, we've released version |
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:
jib/jib-core/src/main/java/com/google/cloud/tools/jib/image/ReproducibleLayerBuilder.java
Line 68 in 8fbdb2e
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:
The text was updated successfully, but these errors were encountered: