Skip to content

1.10-rc1 docker run --ip doesn't handle special "default" network case #19417

@thaJeztah

Description

@thaJeztah

Docker uses a special ("default") value for --net if no network is specified.

The "default" value is set as default value in this flag;
https://github.com/docker/docker/blob/73a5393bf3530815a608725fe2546121ccadbfe4/runconfig/opts/parse.go#L83

And was introduced here;
da5a3e6

However, docker run --ip=... does not treat this value as special, and will look for a network by that name:

docker run --ip=172.17.0.18 -itd busybox sh
0267261b0fb81d7dd7c660935f71e44deb5ba202c9e0ff4925f9bbf0231dcf78
docker: Error response from daemon: network default not found.

Where, instead, it should produce:

docker: Error response from daemon: User specified IP address is supported on user defined networks only.

(I'm not a big fan of this "default" special value, but I'll create a separate issue for that)

Metadata

Metadata

Assignees

Labels

area/networkingNetworkingkind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.priority/P2Normal priority: default priority applied.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions