oci runtime error: container_linux.go:247; not a directory
Description of problem
When trying to install kiwi with the "docker-compose up -d" command, I received the error message below:
ERROR: for kiwi_web Cannot start service web: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused "rootfs_linux.go:58: mounting \"/root/kiwi/contrib/ssl/kiwi-https.crt\" to rootfs \"/var/lib/docker/overlay2/3b1fce1add8fe03675aa0cd26b1d765cc4c3ce993c4a7a9a9becdc0a5dfffefc/merged\" at \"/var/lib/docker/overlay2/3b1fce1add8fe03675aa0cd26b1d765cc4c3ce993c4a7a9a9becdc0a5dfffefc/merged/etc/pki/tls/certs/localhost.crt\" 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
ERROR: for web Cannot start service web: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused "rootfs_linux.go:58: mounting \"/root/kiwi/contrib/ssl/kiwi-https.crt\" to rootfs \"/var/lib/docker/overlay2/3b1fce1add8fe03675aa0cd26b1d765cc4c3ce993c4a7a9a9becdc0a5dfffefc/merged\" at \"/var/lib/docker/overlay2/3b1fce1add8fe03675aa0cd26b1d765cc4c3ce993c4a7a9a9becdc0a5dfffefc/merged/etc/pki/tls/certs/localhost.crt\" 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 ERROR: Encountered errors while bringing up the project.
Component (web, API, etc)
Web; docker-compose.yml
How often reproducible
Every time I run it on Centos 7
Steps to Reproduce
Follow the steps on the page: http://kiwitcms.readthedocs.io/en/latest/installing_docker.html
Solution
I modified the docker-compose.yml file as below, then ran it again and it worked well.
Original: volumes: - uploads:/var/kiwi/uploads - ./contrib/ssl/kiwi-https.crt:/etc/pki/tls/certs/localhost.crt - ./contrib/ssl/kiwi-https.key:/etc/pki/tls/private/localhost.key
Updated: volumes: - uploads:/var/kiwi/uploads - ./contrib/ssl/kiwi-https.crt:/merged/etc/pki/tls/certs/localhost.crt - ./contrib/ssl/kiwi-https.key:/merged/etc/pki/tls/private/localhost.key
There is no directory named as "merged" inside the docker container, so it always failed. For more info about the settings here, please go to the page below about bind mounts: https://docs.docker.com/storage/bind-mounts/
Hope this helps you when you encounter similar error message!
Anyway, I do not understand why the sample docker-compose.yml file does not include "merged".
Every time I run it on Centos 7
The docker version on CentOS 7 and RHEL 7 is older than upstream and does not support mounting of files. It only supports mounting of directories.
I will update the docker-compose.yml file to take care of this however it may not resolve the problem for you. If you decide to mount a local_settings.py file onto product.py inside the container (to override settings without rebuilding the image) then you will hit the same problem.
The only other way is to upgrade your docker to something newer.
Thanks for your comments. I think I already have the new version. Which version I suppose to install?
[root@localhost ~]# docker --version Docker version 18.02.0-ce, build fc4de44