{"id":"b5e142a5617d5124","repo":"docker/cli","slug":"tmpfs-options-are-incompatible-with-type-bind","errorCode":null,"errorMessage":"tmpfs options are incompatible with type bind","messagePattern":"tmpfs options are incompatible with type bind","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/compose/convert/volume.go","lineNumber":133,"sourceCode":"\t\t}\n\t}\n\treturn result, nil\n}\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}","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/compose/convert/volume.go#L115-L151","documentation":"Raised by handleBindToMount in docker/cli's compose converter (used by `docker stack deploy`) when a service volume declared as `type: bind` also carries a `tmpfs:` options block. Each mount type in the long volume syntax accepts only its own options struct, and the converter rejects any foreign options block outright rather than silently ignoring it.","triggerScenarios":"A compose file service volume with `type: bind` that also sets `tmpfs.size` (volume.Tmpfs != nil after parsing), passed through convert.Service/convertServiceVolumes during `docker stack deploy` or any code calling handleBindToMount.","commonSituations":"Copy-pasting a tmpfs volume entry and changing only `type` to bind; YAML indentation placing a tmpfs block under the wrong volume entry; templating/anchors merging option blocks from another mount definition.","solutions":["Remove the `tmpfs:` block from the bind-mount volume entry in the compose file","If tmpfs behavior was intended, change `type: bind` to `type: tmpfs` and drop the `source:` field","If both are needed, split into two separate volume entries, one bind and one tmpfs"],"exampleFix":"# before\nvolumes:\n  - type: bind\n    source: /host/data\n    target: /data\n    tmpfs:\n      size: 10000000\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","config-validation"],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}