How can I fix the error mounting caused "not a directory" when using docker-compose?

I am having too much trouble setting up tyk and dashboard. Here are the steps I have followed:

  1. Cloned https://github.com/lonelycode/tyk_quickstart/ repository
  2. Executed docker-compose up --force-recreate

This failed with the following error:

Removing tykquickstart_tyk_dashboard_1
Removing tykquickstart_tyk_gateway_1
Removing tykquickstart_tyk_pump_1
Recreating tykquickstart_tyk_mongo_1
Recreating bc0e91418a49_tykquickstart_tyk_pump_1
Recreating tykquickstart_tyk_redis_1
Recreating 600b78e96ac5_tykquickstart_tyk_gateway_1
Recreating d7c45ac038d8_tykquickstart_tyk_dashboard_1

ERROR: for tyk_dashboard  Cannot start service tyk_dashboard: oci runtime error: rootfs_linux.go:53: mounting "/mnt/sda1/var/lib/docker/aufs/mnt/10fca6bcaa7d13b75f7018d719c9894774e010d1afa90ed637a00e458aa4ce12/opt/tyk-dashboard/tyk_analytics.conf" to rootfs "/mnt/sda1/var/lib/docker/aufs/mnt/10fca6bcaa7d13b75f7018d719c9894774e010d1afa90ed637a00e458aa4ce12" caused "not a directory"

ERROR: for tyk_gateway  Cannot start service tyk_gateway: oci runtime error: rootfs_linux.go:53: mounting "/mnt/sda1/var/lib/docker/aufs/mnt/4cb93e8420c3e20c46f45be4fab4dfe876ce8aa3e145cbfa45e2d0966d8228d3/opt/tyk-gateway/tyk.conf" to rootfs "/mnt/sda1/var/lib/docker/aufs/mnt/4cb93e8420c3e20c46f45be4fab4dfe876ce8aa3e145cbfa45e2d0966d8228d3" caused "not a directory"

ERROR: for tyk_pump  Cannot start service tyk_pump: oci runtime error: rootfs_linux.go:53: mounting "/mnt/sda1/var/lib/docker/aufs/mnt/3b4579c08f804d8e894351918e3abcc1884f4e68852ee7a8a6ee5775615b44fa/opt/tyk-pump/pump.conf" to rootfs "/mnt/sda1/var/lib/docker/aufs/mnt/3b4579c08f804d8e894351918e3abcc1884f4e68852ee7a8a6ee5775615b44fa" caused "not a directory"
ERROR: Encountered errors while bringing up the project.

I am using docker on OSX. Docker version 1.12.1, build 6f9534c. I am using docker machine and hostnames are setup like the following:

192.168.99.100 www.tyk-portal-test.com
192.168.99.100 tyk_dashboard
192.168.99.100 tyk_gateway

Any help to get this up and running will really helpful. Thanks in advance.

Our QuickStart has been tested with Kitematic (Docker toolbox) on OSX:

1 Like

Hi Martin,

Thanks for the quick response. I have tried with Docker toolbox and Kitematic. But still the error persists. Any idea to debug this?

BTW, is there a reason why TYK is not providing binaries for OSX?

Hi Navaneeth

The errors you are reporting above, look to be related to your docker setup? Have you been using docker successfully for other applications or is this the first time you’ve had Docker setup?

Tyk is available for most linux variants, we haven’t had any requests for OSX before - what would be your use case for running Tyk on OSX?

James

Seems to be a Docker/OSX error, can you check this thread? It’s related:

As James said, there are no official builds for OSX. However you may fetch the source code and build it yourself, I use it for development purposes, under OSX and works just fine!

Hi Navneeth,

Not sure if you have fixed your problem. I got something similar and fixed it by changing mount directories in docker compose file to a location that exists on my Mac.

tyk_redis:
        image: redis:latest
        hostname: redis
        volumes: 
            - /Users/gauravverma/workspace/data/tyk/redis:/data
        ports:
            - "6379:6379"
1 Like

I’m also getting the file / directory mounting error.

W10 v1607 (14393.0)
Docker version 1.13.0, build 49bf474
docker-machine.exe version 0.9.0, build 15fd4c7
docker-compose version 1.10.0, build 4bd6f1a0

PS> docker-compose up -d --force-recreate

Removing tykquickstart_tyk_dashboard_1
Removing tykquickstart_tyk_gateway_1
Removing tykquickstart_tyk_pump_1
Recreating 3c0e03601c5f_tykquickstart_tyk_pump_1
Recreating 3f4be03234f4_tykquickstart_tyk_gateway_1
Recreating ef6e7e261653_tykquickstart_tyk_dashboard_1
Recreating tykquickstart_tyk_redis_1
Recreating tykquickstart_tyk_mongo_1

ERROR: for tyk_dashboard Cannot start service tyk_dashboard: oci runtime error: container_linux.go:247: starting container process caused “process_linux.go:359: container init caused "rootfs_linux.go:54: mounting \"/c/source/tyk_quickstart/tyk_analytics.conf\" to rootfs \"/mnt/sda1/var/lib/docker/aufs/mnt/fa6e3cf3d0ac049dbc950b73c55a5f26add6b0f131d8858e56d1ddf0bbdf5dfb\" at \"/mnt/sda1/var/lib/docker/aufs/mnt/fa6e3cf3d0ac049dbc950b73c55a5f26add6b0f131d8858e56d1ddf0bbdf5dfb/opt/tyk-dashboard/tyk_analytics.conf\" 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 tyk_gateway Cannot start service tyk_gateway: oci runtime error: container_linux.go:247: starting container process caused “process_linux.go:359: container init caused "rootfs_linux.go:54: mounting \"/c/source/tyk_quickstart/tyk.conf\" to rootfs \"/mnt/sda1/var/lib/docker/aufs/mnt/cc49e3203814cab50ab15dd8d6417fec47a85674b767cf0c4e383c23f87a4522\" at \"/mnt/sda1/var/lib/docker/aufs/mnt/cc49e3203814cab50ab15dd8d6417fec47a85674b767cf0c4e383c23f87a4522/opt/tyk-gateway/tyk.conf\" 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 tyk_pump Cannot start service tyk_pump: oci runtime error: container_linux.go:247: starting container process caused “process_linux.go:359: container init caused "rootfs_linux.go:54: mounting \"/c/source/tyk_quickstart/pump.conf\" to rootfs \"/mnt/sda1/var/lib/docker/aufs/mnt/43c422b17d78ea08263fa3228ce6f76109ab4529d3597a1799d8971b1e74766b\" at \"/mnt/sda1/var/lib/docker/aufs/mnt/43c422b17d78ea08263fa3228ce6f76109ab4529d3597a1799d8971b1e74766b/opt/tyk-pump/pump.conf\" 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.

Well, it isn’t a directory, it’s a file but obviously this must be working for others. Perhaps it’s a Windows 10 thing?

I did try shifting the directory under my home directory:

but this didn’t help.

Any suggestions gratefully received!

Docker on windows is very picky about what paths it can access - in particular they must all be relative to the root of the compose file IIRC