docker/cli ยท error
bind options are incompatible with type volume
Error message
bind options are incompatible with type volume
What it means
Raised by handleVolumeToMount in the docker CLI's compose-to-swarm converter when a service volume entry whose type resolves to 'volume' (or an empty type, which defaults to 'volume') also carries a 'bind:' options block. Each mount type accepts only its own option struct, so the converter fails fast rather than silently ignoring bind options (like propagation) that the engine would never apply to a named volume mount.
Source
Thrown at cli/compose/convert/volume.go:51
Consistency: mount.Consistency(volume.Consistency),
}
}
func handleVolumeToMount(
volume composetypes.ServiceVolumeConfig,
stackVolumes volumes,
namespace Namespace,
) (mount.Mount, error) {
result := createMountFromVolume(volume)
if volume.Image != nil {
return mount.Mount{}, errors.New("images options are incompatible with type volume")
}
if volume.Tmpfs != nil {
return mount.Mount{}, errors.New("tmpfs options are incompatible with type volume")
}
if volume.Bind != nil {
return mount.Mount{}, errors.New("bind options are incompatible with type volume")
}
if volume.Cluster != nil {
return mount.Mount{}, errors.New("cluster options are incompatible with type volume")
}
// Anonymous volumes
if volume.Source == "" {
return result, nil
}
stackVolume, exists := stackVolumes[volume.Source]
if !exists {
return mount.Mount{}, fmt.Errorf("undefined volume %q", volume.Source)
}
result.Source = namespace.Scope(volume.Source)
result.VolumeOptions = &mount.VolumeOptions{}
if volume.Volume != nil {View on GitHub (pinned to e9452d6e78)
Solutions
- Remove the 'bind:' block from the volume entry, or change 'type: volume' to 'type: bind' if a host-path bind mount was intended.
- If you need propagation settings, use type: bind with a host path source; named volumes do not support bind propagation.
- Validate the file with 'docker compose config' before deploying.
Example fix
# before
volumes:
- type: volume
source: data
target: /data
bind:
propagation: rshared
# after
volumes:
- type: volume
source: data
target: /data When it happens
Trigger: Running 'docker stack deploy' (or any caller of convert.Volumes) with a compose file where a service's long-form volume entry has type: volume (or omits type) but includes a bind: sub-mapping, e.g. bind: {propagation: rshared}.
Common situations: Copy-pasting a bind-mount entry and changing only the type field; editing type: bind to type: volume without removing the bind options; templating/YAML anchors merging bind options into all volume entries.
Related errors
- cluster options are incompatible with type volume
- invalid image source, source cannot be empty
- volume options are incompatible with type image
- volume options are incompatible with type bind
- cluster options are incompatible with type bind
AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01).
Data as JSON: /data/errors/3a8eddc5e9f78c7b.json.
Report an issue: GitHub.