docker / cli

The Docker CLI
Apache License 2.0
4.91k stars 1.93k forks source link

Invalid Mount Config Error on Windows with Docker CE 27.2.1 #5453

Closed freeurcom closed 1 month ago

freeurcom commented 1 month ago

Description

After updating Docker CE from version 24.x.x to 27.x.x on Windows Server 2022, I encountered an error when attempting to use bind mounts in a Docker Compose file. The error indicates an invalid mount configuration due to an invalid propagation mode (rshared or rprivate), which should not apply to Windows systems.

Actual behaviour An error occurs, and the container fails to start. The error message is: Error response from daemon: invalid mount config for type "bind": invalid propagation mode: rshared

Additional Information

Reproduce

  1. Environment Setup:
  1. Create a compose.yml file with the following content:
services:
  mongodb:
    image: mongo:7.0.14-rc0-nanoserver-ltsc2022
    container_name: mongodb-production
    ports:
      - "27017:27017"
    volumes:
      - F:/phoenix-lej/data/db:C:/data/db
    restart: on-failure:30
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "200"
        compress: "true"
  1. Run the Docker Compose command:
docker-compose up

Expected behavior

The MongoDB container starts successfully, with the host directory F:/phoenix-lej/data/db bound to C:/data/db inside the container.

docker version

Client:
 Version:           27.2.1
 API version:       1.47
 Go version:        go1.22.7
 Git commit:        9e34c9b
 Built:             Fri Sep  6 12:09:12 2024
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.2.1
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.7
  Git commit:       8b539b8
  Built:            Fri Sep  6 12:08:06 2024
  OS/Arch:          windows/amd64
  Experimental:     false

docker info

Client:
 Version:    27.2.1
 Context:    default
 Debug Mode: false
 Plugins:
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.5
    Path:     C:\ProgramData\Docker\cli-plugins\docker-compose.exe

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 1
 Server Version: 27.2.1
 Storage Driver: windowsfilter
  Windows:
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local splunk syslog
 Swarm: inactive
 Default Isolation: process
 Kernel Version: 10.0 20348 (20348.1.amd64fre.fe_release.210507-1500)
 Operating System: Microsoft Windows Server Version 21H2 (OS Build 20348.2700)
 OSType: windows
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.909GiB
 Name: FREEURCOM-BUILD
 ID: 9087e57c-cc05-4b8e-9446-db59d51a5f75
 Docker Root Dir: C:\ProgramData\Docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine

[DEPRECATION NOTICE]: API is accessible on http://127.0.0.1:2375 without encryption.
         Access to the remote API is equivalent to root access on the host. Refer
         to the 'Docker daemon attack surface' section in the documentation for
         more information: https://docs.docker.com/go/attack-surface/
In future versions this will be a hard failure preventing the daemon from starting! Learn more at: https://docs.docker.com/go/api-security/

Additional Info

No response

thaJeztah commented 1 month ago

This is a bug in compose, and you can temporarily downgrade the docker-compose plugin to an older version until v2.29.6 is released; see

thaJeztah commented 1 month ago

I'll close this ticket as duplicate of https://github.com/docker/compose/issues/12137 and because it's not a bug in this repository