Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Invalid mount config for type "bind": source path must be a directory #298

Open
js8080 opened this issue Sep 20, 2019 · 4 comments
Open

Comments

@js8080
Copy link

js8080 commented Sep 20, 2019

Error creating inferno_nginx_server_1
I'm trying to start inferno with: docker-compose up

I'm running Docker Engine - Enterprise on Windows Server 2019 standard
I have docker configured to use Linux containers.
I had Inferno working on my own personal machine with Windows 8 and Docker Desktop but now I am attempting to run it on Windows Server 2019 which doesn't seem to support Docker Desktop. Hence, I'm just using Docker Engine and compose from powershell.

Your environment

Steps to reproduce
When I run docker-compose up I get this error:

Step 4/4 : EXPOSE 4567
 ---> Running in 596d367909f9
Removing intermediate container 596d367909f9
 ---> 10855ae52912
Successfully built 10855ae52912
Successfully tagged inferno_ruby_server:latest
WARNING: Image for service ruby_server was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Pulling nginx_server (nginx:)...
latest: Pulling from library/nginx
b8f262c62ec6: Pull complete
a6639d774c21: Pull complete
22a7aa8442bf: Pull complete
Digest: sha256:9688d0dae8812dd2437947b756393eb0779487e361aa2ffbc3a529dca61f102c
Status: Downloaded newer image for nginx:latest
Creating inferno_ruby_server_1 ... done
Creating inferno_nginx_server_1 ... error

ERROR: for inferno_nginx_server_1  Cannot create container for service nginx_server: invalid volume specification: 'C:\Inferno\inferno\deployment-files\nginx.conf:/etc/nginx/nginx.conf:ro': invalid mount config for type "bind": source path must be a directory

ERROR: for nginx_server  Cannot create container for service nginx_server: invalid volume specification: 'C:\Inferno\inferno\deployment-files\nginx.conf:/etc/nginx/nginx.conf:ro': invalid mount config for type "bind": source path must be a directory
ERROR: Encountered errors while bringing up the project.
PS C:\Inferno\inferno>

Expected behavior
Inferno should start :)

Actual behavior
Error as shown above.

@js8080
Copy link
Author

js8080 commented Sep 20, 2019

I've been investigating this further. It seems this may be an issue with containers running on Windows. At the very end of this article, the author states:

One quirk remains. You still can't mount a single file as a volume, you'll get invalid mount config for type "bind": source path must be a directory

https://blog.sixeyed.com/what-you-can-do-with-docker-in-windows-server-2019-that-you-couldnt-do-in-windows-server-2016/

The strange thing is that this same docker-compose.yml entry works on my Windows 10 PC:

  nginx_server:
    image: nginx
    volumes:
      - ./deployment-files/nginx.conf:/etc/nginx/nginx.conf:ro
    ports:
      - "8080:80"
    command: [nginx, '-g', 'daemon off;']
    links:
      - ruby_server:ruby_server
    depends_on:
      - ruby_server

@js8080
Copy link
Author

js8080 commented Sep 20, 2019

I tried working around this by copying the ./deployment-files/nginx.conf from my host machine to the nginx image in the Inferno\Dockerfile:

# added this section to copy nginx.conf instead of overriding it via volume mapping in docker-compose.yml
FROM nginx:latest
COPY ./deployment-files/nginx.conf /etc/nginx/nginx.conf
# end my addition

FROM ruby:2.5

# Install gems into a temporary directory
COPY Gemfile* ./
RUN gem install bundler && bundle install

# Expose the port
EXPOSE 4567

Then in the docker-compose.yml file I commented out the volumes portion of the nginx_server section:

  nginx_server:
    image: nginx
    #volumes:
    #  - ./deployment-files/nginx.conf:/etc/nginx/nginx.conf:ro
    ports:
      - "8080:80"

That got docker-compose up to work but when I browse to http://localhost:8080/ it just shows a generic "Welcome to nginx!" message and not the Inferno-specific page.

@Jammjammjamm
Copy link
Contributor

Thanks for the report, we will look into this. In the meantime, Inferno can be run in docker without nginx. I don't use windows, so the commands might not be exactly the same, but this is how I would build and run Inferno:

docker build -t inferno .
docker run -p 4567:4567 inferno

If you don't have any local changes you need to include, you can instead download and run a prebuilt image:

docker pull onchealthit/inferno
docker run -p 4567:4567 onchealthit/inferno

After doing one of these, Inferno should be available at localhost:4567.

@js8080
Copy link
Author

js8080 commented Sep 26, 2019

@Jammjammjamm That worked -- I did the latter and ran the prebuilt image. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants