{"id":"632e5b231ea5406b","repo":"docker/cli","slug":"invalid-tmpfs-source-source-must-be-empty","errorCode":null,"errorMessage":"invalid tmpfs source, source must be empty","messagePattern":"invalid tmpfs source, source must be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/compose/convert/volume.go","lineNumber":150,"sourceCode":"\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}\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}","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/compose/convert/volume.go#L132-L168","documentation":"Raised by handleTmpfsToMount when a `type: tmpfs` service volume specifies a `source`. A tmpfs mount is an in-memory filesystem created fresh at the target path; it has no backing source by definition, so any non-empty Source field is rejected as a contradiction.","triggerScenarios":"Compose long-syntax volume with `type: tmpfs` and a non-empty `source:` (or short syntax `src:dst` parsed with a source) converted during `docker stack deploy`.","commonSituations":"Changing an existing bind/volume entry's type to tmpfs and forgetting to delete `source:`; assuming tmpfs needs a named source like a volume mount; using short syntax `name:/path` with `type: tmpfs` in generated configs.","solutions":["Remove the `source:` field from the tmpfs volume entry","If the data must come from a host path or named volume, use `type: bind` or `type: volume` instead"],"exampleFix":"# before\nvolumes:\n  - type: tmpfs\n    source: mydata\n    target: /cache\n# after\nvolumes:\n  - type: tmpfs\n    target: /cache\n    tmpfs:\n      size: 100000000","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["docker","compose","stack-deploy","tmpfs","config-validation"],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}