I want to create temporary files in my spring boot application. I build images using JIB and deploy them in kubernetes. When I tried to create temporary files I received an error because container was started by non root user.
Now I'm looking for workaround to allow my application saves files inside an image's file system. I've seen this extension for JIB which provides possibility to change ownership of directory. I've tried many times with different configs to implement it by myself but all my tries failed. And here it is my config which also doesn't work as well:
jib {
from.image = "..."
to.image = "..."
container {
user = '1000'
}
extraDirectories {
paths {
path {
from = 'export'
into = '/app/export'
}
}
}
pluginExtensions {
pluginExtension {
implementation = 'com.google.cloud.tools.jib.gradle.extension.ownership.JibOwnershipExtension'
configuration {
rules {
rule {
glob = 'app/export/**'
ownership = '1000'
}
}
}
}
}
}
Is there a more handy way to reach my goal or I missed something important in my config?
UPD: Jib version is 3.2.0