MarkusK
MarkusK

Reputation: 53

Oci runtime error docker-compose not a directory

I am new to docker and currently struggling with the following problem:

After starting the command in the docker terminal:

OAUTH_CLIENT_ID=<...> OAUTH_CLIENT_SECRET=<...>      
OAUTH_URL_CALLBACK=http://192.168.99.100/api/v1/auth/login docker-compose --
file test/docker-compose.yml up

I get the following error message:

ERROR: for platform  Cannot start service platform: invalid header field 
value "oci runtime error: container_linux.go:247: starting container process 
caused \"process_linux.go:359: container init caused \\\"rootfs_linux.go:53:  
mounting \\\\\\\"/c/users/m_konk01/documents/GitHub/o2r-
platform/test/nginx.conf\\\\\\\" to rootfs 
\\\\\\\"/mnt/sda1/var/lib/docker/aufs/mnt/29c14c514916cf09070c6dd084bee55fa899d9
79b3f7b9521f1ab25e3a8232a0\\\\\\\" at 
\\\\\\\"/mnt/sda1/var/lib/docker/aufs/mnt/29c14c514916cf09070c6dd084bee55fa899d9
 79b3f7b9521f1ab25e3a8232a0/etc/nginx/nginx.conf\\\\\\\" caused \\\\\\\"not 
a directory\\\\\\\"\\\"\"\n" [31mERROR[0m: Encountered errors while bringing up the project.

The docker-compose.yml starts several docker containers and contains the following platform settings:

platform:
image: nginx:latest
depends_on:
  - container1
  - container2
  - container3
  - container4
volumes:
  - "./nginx.conf:/etc/nginx/nginx.conf:ro"
  - "../client:/etc/nginx/html"
ports:
  - "80:80"

Docker version

$ docker version
Client:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Wed Oct 26 23:26:11 2016
 OS/Arch:      windows/amd64

Server:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Wed Oct 26 23:26:11 2016
 OS/Arch:      linux/amd64

Would be happy for any ideas. My search was not successful so far.

Upvotes: 1

Views: 1956

Answers (2)

Bala
Bala

Reputation: 973

I faced similar issue due to volume mount was not worked properly. So docker default behavior consider this /nginx.conf as directory and gives this error.

To confirm this, you can ssh into your image and go to shared directory and check the files exist or not.

Example: docker exec -it nginx sh and go to /etc/nginx/html you won't see your local files. Then you can confirm volume share was not working. you need to fix that.

If you are using windows 10 (hyper-v), first you need to share your drive and check.

However you need to find the solution to mound your shared directory first.

Upvotes: 0

Gabbax0r
Gabbax0r

Reputation: 1836

it seems like you want to mount a file to a file. i remember on your docker-version its not allowed. you have to move your nginx.conf inside of your Dockerfile

Dockerfile:

....
ADD         nginx.conf  /tmp/

RUN         mv /tmp/nginx.conf /etc/nginx/nginx.conf && \

....

this should work for you. if not show me your next error code

Upvotes: 1

Related Questions