{"id":"058b060842230a99","repo":"docker/cli","slug":"volume-options-are-incompatible-with-type-tmpfs","errorCode":null,"errorMessage":"volume options are incompatible with type tmpfs","messagePattern":"volume options are incompatible with type tmpfs","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/compose/convert/volume.go","lineNumber":156,"sourceCode":"\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\nfunc handleNpipeToMount(volume composetypes.ServiceVolumeConfig) (mount.Mount, error) {\n\tresult := createMountFromVolume(volume)\n","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/compose/convert/volume.go#L138-L174","documentation":"Raised by handleTmpfsToMount when a `type: tmpfs` volume carries a `volume:` options block (e.g. nocopy, subpath). Those options configure named-volume mounts only, so the converter fails fast on the inconsistent config.","triggerScenarios":"ServiceVolumeConfig with Type tmpfs and Volume != nil, e.g. `type: tmpfs` plus `volume: {nocopy: true}`, during `docker stack deploy`.","commonSituations":"Converting a named-volume entry to tmpfs and leaving the `volume:` block behind; generated compose files that emit a `volume:` block for every entry regardless of type.","solutions":["Remove the `volume:` block from the tmpfs entry","If named-volume semantics (nocopy/subpath) are wanted, use `type: volume` with a `source:` instead"],"exampleFix":"# before\nvolumes:\n  - type: tmpfs\n    target: /cache\n    volume:\n      nocopy: true\n# after\nvolumes:\n  - type: tmpfs\n    target: /cache","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}