Skip to content

1.10-rc1 docker run should not create container if network options are invalid #19418

@thaJeztah

Description

@thaJeztah

Related to #19417

Docker creates a container, even if the network options are invalid. For example;

# docker run --ip=172.17.0.18 -itd --net=bridge busybox sh
14bed02fbc4c9901b4d562844ec3d03e7773259375a07037a2f4062ce0671b17
docker: Error response from daemon: User specified IP address is supported on user defined networks only.

The above instruction created a container, and apparently assigned an IP-address

(note that the same IP-address is used for each container that fails);

"Networks": {
    "bridge": {
        "IPAMConfig": {
            "IPv4Address": "172.17.0.18"
        },
        "Links": null,
        "Aliases": null,
        "NetworkID": "",
        "EndpointID": "",
        "Gateway": "",
        "IPAddress": "",
        "IPPrefixLen": 0,
        "IPv6Gateway": "",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "MacAddress": ""
    }
}

Expected result

No container being created if the passed options are invalid

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions