Cannot start service api on Mac OS Sierra
giacomorebonato opened this issue · 1 comments
giacomorebonato commented
Hi, after running docker-compose up
I get the following error.
It seems like a directory is not existing in the container.
WARNING: The CI variable is not set. Defaulting to a blank string.
nodejsapistarter_redis_1 is up-to-date
nodejsapistarter_db_1 is up-to-date
Starting nodejsapistarter_api_1 ...
Starting nodejsapistarter_api_1 ... error
ERROR: for nodejsapistarter_api_1 Cannot start service api: oci runtime error: container_linux.go:265: starting container process caused "process_linux.go:368: container init caused \"rootfs_linux.go:57: mounting \\\"/Users/js/nodejs-api-starter/yarn.lock\\\" to rootfs \\\"/var/lib/docker/aufs/mnt/b0cb450d16003e66779586c0c94a4bd633b32c6a794c5ca7da70257556c17e7d\\\" at \\\"/var/lib/docker/aufs/mnt/b0cb450d16003e66779586c0c94a4bd633b32c6a794c5ca7da70257556c17e7d/usr/src/app/yarn.lock\\\" caused \\\"not a directory\\\"\""
: 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
ERROR: for api Cannot start service api: oci runtime error: container_linux.go:265: starting container process caused "process_linux.go:368: container init caused \"rootfs_linux.go:57: mounting \\\"/Users/js/nodejs-api-starter/yarn.lock\\\" to rootfs \\\"/var/lib/docker/aufs/mnt/b0cb450d16003e66779586c0c94a4bd633b32c6a794c5ca7da70257556c17e7d\\\" at \\\"/var/lib/docker/aufs/mnt/b0cb450d16003e66779586c0c94a4bd633b32c6a794c5ca7da70257556c17e7d/usr/src/app/yarn.lock\\\" caused \\\"not a directory\\\"\""
: 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
ERROR: Encountered errors while bringing up the project.
koistya commented
Make sure that there is yarn.lock
in the root of your project (it's being created or updated when you run yarn install
). Docker-compose is trying to mount this file inside the "api" container:
https://github.com/kriasoft/nodejs-api-starter/blob/462df55/docker-compose.yml#L45
Looking at the error you get, it seems like Docker Compose cannot find it.