Search code examples
spring-bootdockerbuildpack

Build spring-boot OCI image with custom UID/GID


I use the spring-boot-maven-plugin to generate docker OCI containers with the build-image goal.

And the OCI images generated by the paketo buildpack for spring-boot run with the user cnb, which has uid/gui 1000:1000.

Is there a way to customize the user and group id of cnb?


Solution

  • The uid and guid are defined on the stack used by the paketo buildpacks. You can see this in the Dockerfile for the bionic stack.

    The only way to override that would be to create your own stack, but that would mean you wouldn't get updates from the Paketo project, and you'd be maintaining your own base OS.