adding readonly flag to bind mount failing anonymous volume creation #640

Closed
opened 2026-03-07 21:20:55 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @vipul2008 on GitHub (Jan 22, 2022).

Referencing to the example at line no. 8
If I add readonly flag :ro to the line '- ./frontend:/usr/src/app:ro' then I start getting error
If I don't add readonly flag then the container adds the node_modules folder in my host code folder.

Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/var/lib/docker/volumes/8f284ecac85f3340306fa030d267c1b24c27331f118ddb24c6fd48d31a1be4a8/_data" to rootfs at "/usr/src/app/node_modules" caused: mkdir /var/lib/docker/overlay2/4e1f5b46187f9dd7d061c39fff5415fd033a4fe80ac983e08228da2fe732ec09/merged/usr/src/app/node_modules: read-only file system: unknown

I'm using Docker Desktop 4.4 and Docker Compose 2.2.3 using WSL2 Linux Containers
My Host machine is Windows 11 and code is in a folder in d: drive

Originally created by @vipul2008 on GitHub (Jan 22, 2022). Referencing to the [example](https://github.com/docker/awesome-compose/blob/master/react-express-mongodb/docker-compose.yml) at line no. 8 If I add readonly flag **:ro** to the line '- ./frontend:/usr/src/app:ro' then I start getting error If I don't add readonly flag then the container adds the node_modules folder in my host code folder. Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/var/lib/docker/volumes/8f284ecac85f3340306fa030d267c1b24c27331f118ddb24c6fd48d31a1be4a8/_data" to rootfs at "/usr/src/app/node_modules" caused: mkdir /var/lib/docker/overlay2/4e1f5b46187f9dd7d061c39fff5415fd033a4fe80ac983e08228da2fe732ec09/merged/usr/src/app/node_modules: read-only file system: unknown I'm using Docker Desktop 4.4 and Docker Compose 2.2.3 using WSL2 Linux Containers My Host machine is Windows 11 and code is in a folder in d: drive
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/awesome-compose#640