The following works
volumes:
- ./ghost-data:/var/lib/ghost/content
but I am now wanting to mount config.production.json to ./
The file exists in the container:
root@services-dmz:/home/sysadmin/docker/ghost# docker exec -it ghost-ghost-1 bash
fe847b8d491f:/var/lib/ghost# ls
config.development.json config.production.json content content.orig current versions
fe847b8d491f:/var/lib/ghost#
But when I try
volumes:
- ./ghost-data:/var/lib/ghost/content
-./:/var/lib/ghost/config.production.json
I get
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting ā/home/sysadmin/docker/ghostā to rootfs at ā/var/lib/ghost/config.production.jsonā: mount /home/sysadmin/docker/ghost:/var/lib/ghost/config.production.json (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
I have also tried:
volumes:
- ./ghost-data:/var/lib/ghost/content
-./config.production.json:/var/lib/ghost/config.production.json
Which returns the same error but creates a directory called config.production.json on the mounted volume.
I have read a number of posts but canāt work out what I am doing wrong.