{"id":"06e19999b58a6f18","repo":"docker/cli","slug":"cluster-options-are-incompatible-with-type-bind","errorCode":null,"errorMessage":"cluster options are incompatible with type bind","messagePattern":"cluster options are incompatible with type bind","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/compose/convert/volume.go","lineNumber":136,"sourceCode":"}\n\nfunc handleBindToMount(volume composetypes.ServiceVolumeConfig) (mount.Mount, error) {\n\tresult := createMountFromVolume(volume)\n\n\tif volume.Source == \"\" {\n\t\treturn mount.Mount{}, errors.New(\"invalid bind source, source cannot be empty\")\n\t}\n\tif volume.Volume != nil {\n\t\treturn mount.Mount{}, errors.New(\"volume options are incompatible with type bind\")\n\t}\n\tif volume.Image != nil {\n\t\treturn mount.Mount{}, errors.New(\"image options are incompatible with type bind\")\n\t}\n\tif volume.Tmpfs != nil {\n\t\treturn mount.Mount{}, errors.New(\"tmpfs options are incompatible with type bind\")\n\t}\n\tif volume.Cluster != nil {\n\t\treturn mount.Mount{}, errors.New(\"cluster options are incompatible with type bind\")\n\t}\n\tif volume.Bind != nil {\n\t\tresult.BindOptions = &mount.BindOptions{\n\t\t\tPropagation: mount.Propagation(volume.Bind.Propagation),\n\t\t}\n\t}\n\treturn result, nil\n}\n\nfunc handleTmpfsToMount(volume composetypes.ServiceVolumeConfig) (mount.Mount, error) {\n\tresult := createMountFromVolume(volume)\n\n\tif volume.Source != \"\" {\n\t\treturn mount.Mount{}, errors.New(\"invalid tmpfs source, source must be empty\")\n\t}\n\tif volume.Bind != nil {\n\t\treturn mount.Mount{}, errors.New(\"bind options are incompatible with type tmpfs\")\n\t}","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/compose/convert/volume.go#L118-L154","documentation":"Raised by handleBindToMount when a `type: bind` service volume also carries a `cluster:` options block. Cluster options apply only to Swarm cluster (CSI) volumes, so the converter fails fast instead of ignoring a block that can never take effect on a bind mount.","triggerScenarios":"Compose long-syntax volume with `type: bind` where the parsed ServiceVolumeConfig has Cluster != nil, converted during `docker stack deploy`.","commonSituations":"Adapting a cluster-volume entry to a bind mount without removing the cluster block; mixing CSI volume config into the wrong service volume via YAML anchors or merge keys.","solutions":["Delete the `cluster:` block from the bind volume entry","If a CSI/cluster volume was intended, set `type: cluster` and remove bind-specific fields"],"exampleFix":"# before\nvolumes:\n  - type: bind\n    source: /host/data\n    target: /data\n    cluster: {}\n# after\nvolumes:\n  - type: bind\n    source: /host/data\n    target: /data","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["docker","compose","stack-deploy","bind-mount","swarm","config-validation"],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}