I'm trying to mount a writable Docker volume as a child of a read-only volume, but I get this error:
ERROR: for wordpress rpc error: code = 2 desc = "oci runtime error:
could not synchronise with container process: mkdir /mnt/sda1/var/lib
/docker/aufs/mnt/.../var/www/html/wp-content/uploads: read-only file
system"
I'm working with a WordPress image, and the two volumes I want to mount are:
- /var/www/html/wp-content: Contains my development code. Read-only, since I don't want any unexpected changes.
- /var/www/html/wp-content/uploads: Files that are uploaded by users. Must be writable.
The quick solution is to move uploads somewhere else, but I'd prefer a Docker solution.
Relevant bits of my docker-compose.yml:
volumes:
uploads:
driver: local
services:
wordpress:
volumes:
- /dev/workspace/wp-content/:/var/www/html/wp-content/
- uploads:/var/www/html/wp-content/uploads