Skip to content

Networking: find better solution for the magic "default" value #19421

@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

This value was needed because Windows does not have a "bridge" network, so requires some special handling to check if the default (type of) network is used, for example, in hostconfig_windows.go

  • Should we use a literal "default" string for the default value? Can we use (e.g.) null (no value) as the default?
  • In the current situation the --net flag shows "default" as it's default value, but (on Linux), the default is actually "bridge", so this is confusing

Just opening this for discussion, not a high-priority case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/networkingNetworkingkind/enhancementEnhancements are not bugs or new features but can improve usability or performance.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions