Coder Social home page Coder Social logo

Comments (3)

dmikusa avatar dmikusa commented on May 5, 2024

The owner of the workspace and the �sub directories is cnb

The expected behavior is that the uid is 1001 and the gid is 1000 at runtime. This is a change that happened between the Bionic builder and the Jammy builder and it was done to improve the out-of-the-box security posture.

Not a great description, but this is mentioned in the docs here. It is described more in this RFC.

Having said that, I don't fully understand what you're reporting here. I would not expect permissions on /workspace to change just by selecting a different Java version. You might see permission differences if you build from source or if you build from a precompiled JAR file. This is because the /workspace permissions are set initially based on the files from the input permissions (i.e. your source files or the contents of your JAR). I don't think they should be drastically different though.

Anyway, if you could expand on the behavior that you're seeing I can take another look. Thanks

from java.

xeromank avatar xeromank commented on May 5, 2024

This is because the /workspace permissions are set initially based on the files from the input permissions (i.e. your source files or the contents of your JAR)

I didn't set any permissions separately. Could you tell me how to do it? Or please provide a related link.

from java.

dmikusa avatar dmikusa commented on May 5, 2024

I didn't set any permissions separately. Could you tell me how to do it? Or please provide a related link.

Building locally & pack build -p my-file.jar

If you're on a Linux or MacOS machine, you can just chmod those files to the desired permissions before you build the image. I don't know what you would do on Windows as permissions work differently there, sorry, not a Windows user. Maybe try WSL? or maybe someone else has some ideas.

Building from source (i.e. maven/gradle are run by buildpacks)

You can set permissions on your source code locally. If you have shell scripts that you package with the app or something like that, they should inherit the local permissions. Because the build tool runs in the build container, the files generated by the build tool will have default permissions set by the container. If you need different permissions, then you would need to have Maven or Gradle change the permissions as part of the build.

from java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.