Docker Community Forums

Share and learn in the Docker community.

Docker context on remote server "Error response from daemon: invalid volume specification"

Hello Together,

I am relatively new using Docker and without changing my configuration I am facing the following issue. Please let me know If i am in the wrong forum.

I use docker context to push my local container (where everything works fine) to my remote server (Debian webserver with docker installed). I use Docker Desktop for Windows on Windows 10. And it is a Python Flask app.

Locally everything works fine.

when I try “docker-compose up build” after “docker context use remote” I am getting the following error:

Error response from daemon: invalid volume specification: ‘C:\Users\user\fin:/fin:rw’

The location where the project is located is “C:\Users\user\fin”

The Dockerfile is:

FROM python:3.8-slim-buster

ENV INSTALL_PATH /app
RUN mkdir -p $INSTALL_PATH
WORKDIR $INSTALL_PATH

ENV PATH="/home/user/.local/bin:${PATH}"

COPY . ./

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

RUN useradd -ms /bin/bash user && chown -R user $INSTALL_PATH
USER user

COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt

RUN pip install --upgrade pip

CMD gunicorn -c "python:config.gunicorn" "fin.app:create_app()"

while the docker-compose.yml is here (the relevant parts)

version: '3.8'

services:
  flask-app:
    container_name: flask-app
    restart: always
    build: .
    command: >
      gunicorn -c "python:config.gunicorn" "fin.app:create_app()"
    environment:
      PYTHONUNBUFFERED: 'true'
    volumes:
      - '.:/fin'
    ports:
      - 8000:8000
    env_file:
      - '.env'

In the .env file I set the option
COMPOSE_CONVERT_WINDOWS_PATHS=1

Thank You in advance for your help.

Best regards,
fin