0

I'm trying to mount a file into a docker container, i tried with volumes or mount but can't figure it out (the file exist on the docker container) :

    -v /home/edsadmin/onlyoffice/logs/onlyoffice:/var/log/onlyoffice  \
    -v /home/edsadmin/onlyoffice/data:/var/www/onlyoffice/Data \
    -v /home/edsadmin/onlyoffice/logs/nginx:/etc/onlyoffice/documentserver/nginx \
    --mount type=bind,source=$(pwd)/onlyoffice/local/local.json,target=/etc/onlyoffice/documentserver/local.json onlyoffice/documentserver ```

Error : 

```docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/home/edsadmin/onlyoffice/local/local.json\\\" to rootfs \\\"/var/lib/docker/overlay2/fb9a952df135aad0d9729e8cf3399a723d5dac8c053ab64f6fc441d2a90e5146/merged\\\" at \\\"/var/lib/docker/overlay2/fb9a952df135aad0d9729e8cf3399a723d5dac8c053ab64f6fc441d2a90e5146/merged/etc/onlyoffice/documentserver/local.json\\\" caused \\\"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.
ERRO[0000] error waiting for container: context canceled
  • That's what I see in the error message: `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.`, you probably need to make sure you are mounting to a directory, not a file. – Yaron Jun 30 '20 at 08:49
  • I'm trying to mount the file not a directory – Valentin Moine Jun 30 '20 at 09:12
  • OK So make sure you are mounting a file to a file or a file to a directory and not vice versa and also make sure all of the files and directories are present and you have permissions to at least read them. – Yaron Jun 30 '20 at 09:38

0 Answers0