{"record":{"id":"a08a752ff55e1cc3","repo":"docker/cli","slug":"bind-options-are-incompatible-with-type-tmpfs","errorCode":null,"errorMessage":"bind options are incompatible with type tmpfs","messagePattern":"bind options are incompatible with type tmpfs","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/compose/convert/volume.go","lineNumber":153,"sourceCode":"\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}\n\tif volume.Volume != nil {\n\t\treturn mount.Mount{}, errors.New(\"volume options are incompatible with type tmpfs\")\n\t}\n\tif volume.Image != nil {\n\t\treturn mount.Mount{}, errors.New(\"image options are incompatible with type tmpfs\")\n\t}\n\tif volume.Cluster != nil {\n\t\treturn mount.Mount{}, errors.New(\"cluster options are incompatible with type tmpfs\")\n\t}\n\tif volume.Tmpfs != nil {\n\t\tresult.TmpfsOptions = &mount.TmpfsOptions{\n\t\t\tSizeBytes: volume.Tmpfs.Size,\n\t\t}\n\t}\n\treturn result, nil\n}\n","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/compose/convert/volume.go#L135-L171","documentation":"Returned by handleTmpfsToMount (cli/compose/convert/volume.go:152-153). Propagation is a bind-mount concept and is meaningless for an in-memory tmpfs, so a `bind:` block on a tmpfs entry is rejected.","triggerScenarios":"ServiceVolumeConfig with Type==\"tmpfs\" and Bind!=nil passed to convertVolumeToMount().","commonSituations":"Changing a bind entry to tmpfs without removing the `bind: { propagation: ... }` block; YAML merge pulling in bind options.","solutions":["Delete the `bind:` options block from the tmpfs entry.","If propagation was genuinely needed, the mount is really a bind — restore `type: bind` and supply a host source."],"exampleFix":"# before\nvolumes:\n  - type: tmpfs\n    target: /cache\n    bind:\n      propagation: rshared\n\n# after\nvolumes:\n  - type: tmpfs\n    target: /cache","handlingStrategy":"validation","validationCode":"for i, v := range serviceVolumes {\n    if v.Type == \"tmpfs\" && v.Bind != nil {\n        return fmt.Errorf(\"service volume[%d] target=%q: type tmpfs must not declare a bind block\", i, v.Target)\n    }\n}","typeGuard":null,"tryCatchPattern":"mounts, err := convert.Volumes(serviceVolumes, stackVolumes, namespace)\nif err != nil && strings.Contains(err.Error(), \"bind options are incompatible with type tmpfs\") {\n    return fmt.Errorf(\"compose config error: %w (remove the bind: block from the tmpfs entry)\", err)\n}","preventionTips":["Propagation only applies to bind mounts; never carry a bind block onto a tmpfs entry.","Keep type changes and option-block cleanup in the same commit."],"tags":["docker","compose","volumes","tmpfs","bind-mount","config-validation"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}