0

Hello I am trying to run my container with --read-only, but when I receive a request for multipart upload i tries to create a temporary file:

java.nio.file.FileSystemException: /tmp/undertow3773194840223053389upload: Read-only file system.

Is it possible to make it only in memory?

thanks =)

1 Answers1

1

You can use something like below

docker run -it --read-only --tmpfs /tmp alpine sh

This will allow you to write files in /tmp. So what you need is a additional --tmpfs /tmp in your docker run command

Tarun Lalwani
  • 142,312
  • 9
  • 204
  • 265
  • I was trying to avoid write even in the temporary file system. but I don't think there is a way to do it. Tried to increase the spring threshold, I thought it would make the file stay in memory: spring.http.multipart.file-size-threshold=100MB //example – Marcelo Juan Saciloto Dec 13 '17 at 15:11
  • The error does not happen when I start the application, it is when I post the files. – Marcelo Juan Saciloto Dec 13 '17 at 15:20
  • That is because the post file needs to be written to some place before it is handed over to spring boot. See if you can use/configure `maxInMemorySize`? https://stackoverflow.com/questions/1952633/will-spring-hold-contents-in-memory-or-stores-in-the-disk – Tarun Lalwani Dec 13 '17 at 15:27