Skip to content

/containers/create no longer accepts a string for CapAdd or CapDrop #14318

@aanand

Description

@aanand

Similarly to #14170, sending a string for CapAdd or CapDrop when creating a container with a Docker 1.7.0 daemon results in an unmarshaling error.

Assuming a Docker daemon at http://docker:

$ curl -X POST http://docker/v1.19/images/create?fromImage=busybox > /dev/null

$ curl -X POST -H 'Content-Type: application/json' http://docker/v1.19/containers/create -d '{"Image": "busybox", "Cmd": "/bin/true", "HostConfig": {"CapAdd": ["NET_ADMIN"]} }'
{"Id":"c145aca6ba8f2f08b1865f5ae031cdb7dffe163b4d9e750d603146ee1cfc6861","Warnings":null}

$ curl -X POST -H 'Content-Type: application/json' http://docker/v1.19/containers/create -d '{"Image": "busybox", "Cmd": "/bin/true", "HostConfig": {"CapAdd": "NET_ADMIN"} }'
json: cannot unmarshal string into Go value of type []string

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions