denoland / denoland/deno_docker
Unable to run container with `readOnlyRootFilesystem` and `"nodeModulesDir": "auto"`
- Dominant language
- Dockerfile
- Stars
- 1k
- Forks
- 113
- Avg merge
- 9m
- Merged PRs (30d)
- 1
Description
Like the title says, running the a deno docker container that uses node_module with `"nodeModulesDir": "auto"` on a read only root file system seems to be giving me errors like:
```sh
podman run --rm -it --read-only docker.io/maingufu/rss-hub:latest deno run -A --cached-only --unstable-npm-lazy-caching src/apps/api/main.ts
Could not initialize cache database '/deno-dir/dep_analysis_cache_v2', deleting and retrying... (SqliteFailure(Error { code: CannotOpen, extended_code: 14 }, Some("unable to open database file")))
Could not initialize cache database '/deno-dir/node_analysis_cache_v2', deleting and retrying... (SqliteFailure(Error { code: CannotOpen, extended_code: 14 }, Some("unable to open database file")))
Could not initialize cache database '/deno-dir/v8_code_cache_v2', deleting and retrying... (SqliteFailure(Error { code: CannotOpen, extended_code: 14 }, Some("unable to open database file")))
Failed to open cache file '/deno-dir/v8_code_cache_v2', performance may be degraded.
Failed to open cache file '/deno-dir/node_analysis_cache_v2', opening in-memory cache.
Failed to open cache file '/deno-dir/dep_analysis_cache_v2', opening in-memory cache.
error: File exists (os error 17), symlink '../../normalize-url@8.0.1/node_modules/normalize-url' -> '/app/node_modules/.deno/@vinejs+vine@3.0.0/node_modules/normalize-url'
```
And if i remove the `nodeModulesDir` from deno.json our setting it to none, will run ok.
Is deno incompatible, or do we have lower performace while running with `readOnlyRootFilesystem` enabled?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the provided podman command and the deno.json setting for nodeModulesDir. Trace how the container uses /deno-dir and /app/node_modules with --read-only, then compare the reported cache and symlink errors. Done means establishing whether this combination is supported and documenting or fixing the observed failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100