question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

executable permission is never set

See original GitHub issue

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:

https://github.com/GoogleContainerTools/jib/blob/8fbdb2e1b1018565388c3036540125b852ddc142/jib-core/src/main/java/com/google/cloud/tools/jib/image/ReproducibleLayerBuilder.java#L68

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);

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:19 (13 by maintainers)

github_iconTop GitHub Comments

7reactions
coollogcommented, May 7, 2019

@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 extraDirectory configuration to include permissions:

<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

1reaction
danielpetismecommented, Sep 27, 2018

I 👍 this issue. I’ve integrated jib into jhipster generator and I must use a custom entrypoint.sh. This file is stored under src/main/jib and set as executable but once copied on the container image, the file is not executable anymore. This problem forces me to run a dircty chmod +x before running the script 😢 It’s not a blocking point but its a pitfall we could avoid.

I don’t how I could help?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 17 Linux essentials Flashcards - Quizlet
The "execute" permission is never set on files by default. false. Which of the following chown commands will change the myFile user ownership...
Read more >
can't change file permission - Unix & Linux Stack Exchange
Yes, this can occur if your device is formatted with a filesystem that does not support that kind of permission setting, such as...
Read more >
Is executable permission mode S used for anything?
The output displays S if setuid is set, but user permissions do not include execute. However, as long as group or other can...
Read more >
linux - How to set a file as NOT executable? - Super User
Just FYI. CHMOD is used to change permissions of a file. PERMISSION COMMAND U G W rwx rwx rwx...
Read more >
chmod - Change the mode of a file or directory - IBM
chmod never changes the permissions of symbolic links (or external links), because, ... To set group read/write/execute permissions on the directory ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found