Skip to content

Broken volume creation when not passing options #66

@f-sommerauer

Description

@f-sommerauer

When calling cli.CreateVolume(ctx, volName, "local", nil, nil) on the containerz client the resulting volume will have invalid local mount options set, leading to the following configuration:

sudo docker volume inspect some-volume
[
    {
        "CreatedAt": "2026-02-27T16:58:25Z",
        "Driver": "local",
        "Labels": null,
        "Mountpoint": "/var/lib/docker/volumes/some-volume/_data",
        "Name": "some-volume",
        "Options": {
            "device": "",
            "o": "",
            "type": "none"
        },
        "Scope": "local"
    }
]

This results in the following error once the volume is used within a StartContainer command:
Error response from daemon: missing device in volume options

Potential solution (not tested):
Set LocalMountOptions of cpb.CreateVolumeRequest_LocalMountOptions to nil unless at least one options parameter is passed to the client.
Not setting the "device" option unless the "mountpoint" option is set may work as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions