compose icon indicating copy to clipboard operation
compose copied to clipboard

invalid mount config for type volume?

Open eld1887 opened this issue 8 years ago • 3 comments

hi, i want to update my docker-compose, dotnet configuration but after that, i get the follwing error msg after docker-compose up (with the old version of dotnet the solution worked well):

ERROR: for 4c115b1b9fef_4c115b1b9fef_identityServer  Cannot create container for service identityserver: invalid volume specification: '17fa9043120077131e36ea4de1c4a5232b571dd70b5584e9823794ad7a379de5:[“/app”]:rw': invalid mount config for type "volume": invalid mount path: '[“/app”]' mount path must be absolute

ERROR: for identityserver  Cannot create container for service identityserver: invalid volume specification: '17fa9043120077131e36ea4de1c4a5232b571dd70b5584e9823794ad7a379de5:[“/app”]:rw': invalid mount config for type "volume": invalid mount path: '[“/app”]' mount path must be absolute
ERROR: Encountered errors while bringing up the project.

my dockerfile:

FROM microsoft/dotnet:2.0.0-sdk

#Install dockerize
RUN apt-get update && apt-get install -y wget

ENV DOCKERIZE_VERSION v0.4.0
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
    && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
    && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz


WORKDIR /app
COPY run.sh /run.sh
RUN chmod 755 /*.sh
EXPOSE 5000
VOLUME [“/app”]

CMD ["/run.sh"]

my docker-compose file:

version: '3.1'

services:

  identityserver:
    build: ./IdentityServer/docker
    container_name: identityServer
    volumes:
      - ./IdentityServer/:/app/
    links:
      - hawai-dashboard-database:hawai-database
    environment:
      - ASPNETCORE_ENVIRONMET=Development
    ports:
      - "5000:5000"
    depends_on:
      - hawai-dashboard-database

The only thing i have changed is the line at the dockerfile : FROM microsoft/dotnet:1.1-sdk to FROM microsoft/dotnet:2.0.0-sdk

What can be the problem?

eld1887 avatar Feb 24 '18 13:02 eld1887

I'm not well-versed in Windows containers, but I think things will work after you remove the VOLUME instruction from your Dockerfile. Right now you're having a conflict where you declare both a volume (from Dockerfile instruction) and a host mount (from the docker-compose.yml "volumes" section) on /app. As far as I can tell, you only need the latter, and having both probably runs afoul of validation of this rule.

When using Windows-based containers, the destination of a volume inside the container must be one of:

  • a non-existing or empty directory
  • a drive letter other than C:

Let me know if that helps.

shin- avatar Feb 26 '18 18:02 shin-

Have you created a ./data directory on the manager: docker-machine ssh myvm1 "mkdir ./data"

timothy2005 avatar Jul 11 '18 09:07 timothy2005

Try using Powershell. This issue arose for me in Git Bash only.

vrj93 avatar Jan 25 '24 16:01 vrj93