Docker Compose fails on Windows Server 2019

I have the next docker-compose.yml:

version: '3.9'
services:
  server:
    build:
        context: .
        dockerfile: Dockerfile
    environment:
      - "SQLALCHEMY_DATABASE_URI=<DB_CONNECTION_STR>"
      - "RAW_DATA_DIR=/app/mydrive"
      - "INDEXING=False"
    restart: "always"
    volumes:
      - ${CONFIG_PATH}companyLogo.png:/app/files/branding/companyLogo.png
      - mydrive:/app/mydrive
    networks:
      - internal
    ports:
      - '80:80'
    command: "server"
volumes:
  mydrive:
    driver: local
    driver_opts:
      type: cifs
      o: 'username=<USERNAME>,password=<PASSWORD>,domain=<DOMAIN>,uid=5000,gid=6000'
      device: '<LINK_TO_MY_SERVER>'
networks:
  internal:

And azure-pipeline.yml with Azure Agent on Windows Server 2019:

trigger:
- mybranch

variables:
- name: CONFIG_PATH
  value: C:my_project_config

jobs:
- job: BackendDeployment
  pool:
    name: myproject
    demands:
    - agent.name -equals backend-w
  steps:
  - script: |
      cd backend
      docker-compose build
      docker-compose down -v
      docker-compose up -d
    displayName: 'Backend'

However, Azure Agent fails with error when Docker Compose creates the volume:

Volume backend_mydrive not found.
Creating network "backend_internal" with the default driver
Creating volume "backend_mydrive" with local driver
create backend_mydrive: options are not supported on this platform
##[error]Cmd.exe exited with code '1'.

Below is that I found in official Docker documentation:
The built-in local driver on Windows does not support any options.

Unfortunately, I still can’t get what’s a problem? And how to fix or bypass it?

Source: Docker Questions

LEAVE A COMMENT