Run jmix in Docker container with read-only filesystem flag

Dear jmix,

In my current project, we stumbled upon a problem: we can’t run applications in a read-only filesystem.

For example:
when launching an application with “–read-only” flag

docker run --read-only --rm -it -p 8080:8080 ... <ID>

The application failed to start with an error:

java.io.UncheckedIOException: Failed to initialize the PWA registry
        at com.vaadin.flow.server.PwaRegistry.getInstance(PwaRegistry.java:339)
        at java.base/java.util.Optional.map(Unknown Source)
        at com.vaadin.flow.server.VaadinServletService.getPwaRegistry(VaadinServletService.java:220)
...

java.nio.file.FileSystemException: /tmp/imageio6544213842382591041.tmp: Read-only file system
        at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
        at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(Unknown Source)

jmix version: 2.1.1

Running containers with read-only file systems is considered a good practice and a requirement in many companies.

I understand this error derives from the underlying library; however, I wanted to ask you if there are any workarounds to run jmix (flowui) with a read-only filesystem?

Thank you very much in advance!

Please help Jmix team and community members to answer your questions:

  • Provide your Jmix framework and Studio versions. Use Welcome screen in Studio to copy versions.
  • If possible, attach a zip-archive with a sample project or provide a link to a GitHub repository with a minimal, reproducible example. Use Gradle → Zip Project action in Jmix tool window to make an archive.
  • Format source code in your posts by wrapping it in triple backquotes (```).

Hi @oleksii

Could you test a pure Vaadin Flow application in the same environment?
If it doesn’t work and Vaadin doesn’t provide any workaround, there is little we can do.
If it works, please create an issue at Issues · jmix-framework/jmix · GitHub and we’ll try to make Jmix compatible.

Regards,
Konstantin

Hello Konstantin,

I tested the same scenario with a pure Vaadin Flow application. Unfortunately, it fails with the same error. Thus looks like there is nothing jmix could do.

Thank you anyway for checking!

BR,
Oleksii

1 Like