{"id":"88e20d153fe59cfb","repo":"docker/cli","slug":"tmpfs-options-are-incompatible-with-type-image","errorCode":null,"errorMessage":"tmpfs options are incompatible with type image","messagePattern":"tmpfs options are incompatible with type image","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/compose/convert/volume.go","lineNumber":107,"sourceCode":"\t}\n\n\treturn result, nil\n}\n\nfunc handleImageToMount(volume composetypes.ServiceVolumeConfig) (mount.Mount, error) {\n\tresult := createMountFromVolume(volume)\n\n\tif volume.Source == \"\" {\n\t\treturn mount.Mount{}, errors.New(\"invalid image 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 image\")\n\t}\n\tif volume.Bind != nil {\n\t\treturn mount.Mount{}, errors.New(\"bind options are incompatible with type image\")\n\t}\n\tif volume.Tmpfs != nil {\n\t\treturn mount.Mount{}, errors.New(\"tmpfs options are incompatible with type image\")\n\t}\n\tif volume.Cluster != nil {\n\t\treturn mount.Mount{}, errors.New(\"cluster options are incompatible with type image\")\n\t}\n\tif volume.Image != nil {\n\t\tresult.ImageOptions = &mount.ImageOptions{\n\t\t\tSubpath: volume.Image.Subpath,\n\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}","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/compose/convert/volume.go#L89-L125","documentation":"Raised by handleImageToMount when a mount of type 'image' also includes a 'tmpfs:' options block. Tmpfs options (like size) only apply to in-memory tmpfs mounts, so the converter rejects the combination instead of ignoring it.","triggerScenarios":"'docker stack deploy' with a service volume entry combining type: image and tmpfs: options such as tmpfs: {size: 104857600}.","commonSituations":"Reusing a tmpfs entry as a template for an image mount; programmatic compose generation emitting all option blocks for every mount.","solutions":["Remove the 'tmpfs:' block from the image mount entry.","If an in-memory mount was intended, use type: tmpfs with an empty source instead."],"exampleFix":"# before\nvolumes:\n  - type: image\n    source: alpine:latest\n    target: /mnt/img\n    tmpfs:\n      size: 104857600\n# after\nvolumes:\n  - type: image\n    source: alpine:latest\n    target: /mnt/img","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["docker","compose","image-mount","tmpfs","config-validation"],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}