{"record":{"id":"ad0b260f3c533db8","repo":"docker/cli","slug":"image-options-are-incompatible-with-type-npipe","errorCode":null,"errorMessage":"image options are incompatible with type npipe","messagePattern":"image options are incompatible with type npipe","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/compose/convert/volume.go","lineNumber":182,"sourceCode":"\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}\n\tif volume.Volume != nil {\n\t\treturn mount.Mount{}, errors.New(\"volume options are incompatible with type npipe\")\n\t}\n\tif volume.Image != nil {\n\t\treturn mount.Mount{}, errors.New(\"image options are incompatible with type npipe\")\n\t}\n\tif volume.Tmpfs != nil {\n\t\treturn mount.Mount{}, errors.New(\"tmpfs options are incompatible with type npipe\")\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 handleClusterToMount(\n\tvolume composetypes.ServiceVolumeConfig,\n\tstackVolumes volumes,\n\tnamespace Namespace,\n) (mount.Mount, error) {\n\tif volume.Source == \"\" {","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/compose/convert/volume.go#L164-L200","documentation":"Returned by handleNpipeToMount (cli/compose/convert/volume.go:181-182). image.subpath is for image-backed mounts and has no meaning for a Windows named-pipe forward, so a `image:` block on an npipe entry is rejected.","triggerScenarios":"ServiceVolumeConfig with Type==\"npipe\" and Image!=nil passed to convertVolumeToMount().","commonSituations":"Migrating an image-volume entry to npipe without removing the `image:` block; template merge pulling in image options.","solutions":["Delete the `image:` options block from the npipe entry.","If image subpath was intended, change `type:` to `image` and supply an image reference as source."],"exampleFix":"# before\nvolumes:\n  - type: npipe\n    source: \\\\.\\\\pipe\\\\engine\n    target: \\\\.\\\\pipe\\\\engine\n    image:\n      subpath: /app/assets\n\n# after\nvolumes:\n  - type: npipe\n    source: \\\\.\\\\pipe\\\\engine\n    target: \\\\.\\\\pipe\\\\engine","handlingStrategy":"validation","validationCode":"for i, v := range serviceVolumes {\n    if v.Type == \"npipe\" && v.Image != nil {\n        return fmt.Errorf(\"service volume[%d] target=%q: type npipe must not declare an image block\", i, v.Target)\n    }\n}","typeGuard":null,"tryCatchPattern":"mounts, err := convert.Volumes(serviceVolumes, stackVolumes, namespace)\nif err != nil && strings.Contains(err.Error(), \"image options are incompatible with type npipe\") {\n    return fmt.Errorf(\"compose config error: %w (remove the image: block from the npipe entry)\", err)\n}","preventionTips":["image.subpath is image-mount-only; strip it whenever you adopt an entry for npipe.","Lint compose files before deploy."],"tags":["docker","compose","volumes","npipe","image-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"}