quarkus-unleash
quarkus-unleash copied to clipboard
Quarkus Unleash import-file does not work in a container using DinD
It seems that the import-file configuration option is implemented as follows:
- The file is copied to
/tmp - The temporary file is bind-mounted to the unleash container
This is a problem in containers that use DinD, since volume mounts are not visible to the docker daemon. What happens is Unleash gets an empty directory instead of the import file and exits.
In unleash 5.10.0 the logs ends abruptly and unleash exists:
[2025-10-25T14:27:05.926] [INFO] server-impl.js - DB migration: end
[2025-10-25T14:27:06.034] [INFO] service/user-service.js - Creating default user 'admin' with password 'unleash4all'
In recent versions (tried with version 7) they added better logging:
[2025-10-25T15:44:52.542] [INFO] server-impl/postgresVersionWarner - Running PostgreSQL version 16.10 (Ubuntu 16.10-0ubuntu0.24.04.1).
[2025-10-25T15:44:52.586] [INFO] service/user-service.js - Creating default admin user, with username 'admin' and password 'unleash4all'
[ERROR] Error: EISDIR: illegal operation on a directory, read
at async readFileHandle (node:internal/fs/promises:555:24)
at async readFile (file:///unleash/dist/lib/util/read-file.js:2:41)
at async ExportImportService.importFromFile (file:///unleash/dist/lib/features/export-import-toggles/export-import-service.js:112:25)
at async createApp (file:///unleash/dist/lib/server-impl.js:130:9)
at async start (file:///unleash/dist/lib/server-impl.js:195:21)
Cause: In DinD, when Testcontainers tries to bind mount /home/user/config/unleash.json:
- The file exists inside the DinD container (where Maven runs)
- But the outer Docker daemon can't see that file path
- Docker's default behavior when bind mounting a non-existent source is to create a directory
- Unleash receives a directory instead of a file and crashes
Proposed solution:
Instead of using bind mounts use the Unleash API to pass the contents of the import-file. This should work in containers as well as on regular hosts.