{"id":"8066e480ec31cdb6","repo":"docker/cli","slug":"image-options-are-incompatible-with-type-tmpfs","errorCode":null,"errorMessage":"image options are incompatible with type tmpfs","messagePattern":"image options are incompatible with type tmpfs","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/compose/convert/volume.go","lineNumber":159,"sourceCode":"\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\n\tif volume.Source == \"\" {\n\t\treturn mount.Mount{}, errors.New(\"invalid npipe source, source cannot be empty\")\n\t}","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/compose/convert/volume.go#L141-L177","documentation":"Raised by handleTmpfsToMount when a `type: tmpfs` volume carries an `image:` options block (e.g. subpath). Image options apply only to image mounts (mounting an OCI image's filesystem), which is meaningless for an in-memory tmpfs, so the converter rejects it.","triggerScenarios":"ServiceVolumeConfig with Type tmpfs and Image != nil, e.g. `type: tmpfs` plus `image: {subpath: dir}`, during `docker stack deploy`.","commonSituations":"Retyping an image mount to tmpfs without dropping the `image:` block; anchor/template reuse across heterogeneous volume entries.","solutions":["Remove the `image:` block from the tmpfs entry","If mounting image content was intended, use `type: image` with `source:` set to the image reference"],"exampleFix":"# before\nvolumes:\n  - type: tmpfs\n    target: /cache\n    image:\n      subpath: data\n# after\nvolumes:\n  - type: tmpfs\n    target: /cache","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["docker","compose","stack-deploy","tmpfs","image-mount","config-validation"],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}