docker / compose

Define and run multi-container applications with Docker
https://docs.docker.com/compose/
Apache License 2.0
34k stars 5.23k forks source link

[BUG] Starting with version 2.29.3 Binding Mounts do not work anymore with windows containers. #12137

Closed emmaberger closed 1 month ago

emmaberger commented 1 month ago

Description

Version 2.29.3: Using volumes in services defined in docker compose with short syntax (VOLUME:CONTAINER_PATH) give this error when doing "docker compose up": Error response from daemon: hcs::CreateComputeSystem : The request is not supported.

Version 2.29.5: Using volumes in services defined in docker compose with short syntax (VOLUME:CONTAINER_PATH) give this error when doing "docker compose up": Error response from daemon: invalid mount config for type "bind": invalid propagation mode: rprivate.

This worked all fine, up until version 2.29.2, inclusively. From Docker docs "Bind propagation defaults to rprivate for both bind mounts and volumes. It is only configurable for bind mounts, and only on Linux host machines."

We need to have this working again on Windows Host machines as well. Please provide a fix or a workaround.

Steps To Reproduce

Environment: Windows Host Machines

Add any service in a docker compose file and define volumes with short syntax: e.g.

services:
    pretesting-sql.messagebus:

        volumes:
            - D:\deployment\ERP\pretesting\SQLServer\MessageBusDB\data:C:\ESDB\Data
            - D:\deployment\ERP\pretesting\SQLServer\MessageBusDB\logs:C:\ESDB\Logs
            - D:\deployment\ERP\pretesting\SQLServer\certs:C:\ESDB\Certs

Run docker compose up -d

The following happens:
Version 2.29.3:
Using volumes in services defined in docker compose with short syntax (VOLUME:CONTAINER_PATH) give this error when doing "docker compose up": Error response from daemon: hcs::CreateComputeSystem : The request is not supported.

Version 2.29.5:
Using volumes in services defined in docker compose with short syntax (VOLUME:CONTAINER_PATH) give this error when doing "docker compose up": Error response from daemon: invalid mount config for type "bind": invalid propagation mode: rprivate.

### Compose Version

```Text
Docker Compose version v2.29.3
Docker Compose version v2.29.5

Docker Environment

Client:
 Version:    27.2.1
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc.)
    Version:  v0.9.1-beta3
    Path:     C:\Program Files\Docker\cli-plugins\docker-app.exe
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.9.1-docker
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.5
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe

Server:
 Containers: 16
  Running: 12
  Paused: 0
  Stopped: 4
 Images: 210
 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 17763 (17763.1.amd64fre.rs5_release.180914-1434)
 Operating System: Microsoft Windows Server Version 1809 (OS Build 17763.6293)
 OSType: windows
 Architecture: x86_64
 CPUs: 4
 Total Memory: 31.54GiB
 Name: Computer
 ID: ac5c8de9-fb3d-4ab4-94bd-bb3728fa82c7
 Docker Root Dir: D:\ProgramData\docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine

Anything else?

No response

ndeloof commented 1 month ago

regression on 2.29.5 is caused by https://github.com/docker/compose/commit/cb00aaad288ff83ed98835a1edea635800f5b083 - I would have expected windows container engine to just ignore the propagation parameter as it is not implemented - we unfortunately don't have windows container tests on CI. I proposed a fix as https://github.com/docker/compose/pull/12138

error you reported on 2.29.3 is harder to diagnose. I checked docker run --mount xxx is well supported by windows containers, so this should work and the error message doesn't make it obvious what's wrong here. Investigation in progress ...

ndeloof commented 1 month ago

Tested my PR with a short-syntax bind mount on windows with windows-containers-enabled-engine and can't reproduce the reported issue. Would you have a chance to give it a try ?

thaJeztah commented 1 month ago

Also reported in;

That one also reported the rshared being the culprit;

Error response from daemon: invalid mount config for type "bind": invalid propagation mode: rshared
ndeloof commented 1 month ago

fixed by https://github.com/docker/compose/pull/12141