Answer the question
In order to leave comments, you need to log in
What's the docker error?
ERROR: for cenergy_mysql_1 Cannot start service mysql: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/etc/localtime\\\" to rootfs \\\"/var/lib/do
cker/overlay2/b2fc4e93fb6a984da426bf602cc593f20fc1b9694a0dbb08c6bdd2144d63b825/merged\\\" at \\\"/var/lib/docker/overlay2/b2fc4e93fb6a984da426bf602cc593f20fc1b9694a0dbb08c6bdd2144d63b825/merged/usr/share/zoneinfo/UCT\\\" 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
Answer the question
In order to leave comments, you need to log in
well, everything is written - when you mount, you can only mount a file on a file or a directory on a directory. Sometimes it happens that if the volume on the left contains a file that does not exist on the host, then the docker goes crazy. And creates a directory with root:root rights instead.
What could be the solution? To begin with, stop using the simplified -v syntax in docker run or volumes in docker-compose, and use the extended mount syntax (which is with --mount
). Then, if the host does not have the required file, then the docker container will not STUPIDLY start and there will be a clear error message like:
docker: Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /home/local/georg.gaal/formulas.
See 'docker run --help'.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question