MCPcopy Create free account
hub / github.com/ddev/ddev / GetDockerIP

Function GetDockerIP

pkg/dockerutil/docker_manager.go:134–140  ·  view source on GitHub ↗

GetDockerIP returns either the default Docker IP address (127.0.0.1) or the value as configured by Docker host (if it is a tcp:// URL)

()

Source from the content-addressed store, hash-verified

132// GetDockerIP returns either the default Docker IP address (127.0.0.1)
133// or the value as configured by Docker host (if it is a tcp:// URL)
134func GetDockerIP() (string, error) {
135 dm, err := getDockerManagerInstance()
136 if err != nil {
137 return "", err
138 }
139 return dm.hostIP, dm.hostIPErr
140}
141
142// IsRemoteDockerHost returns true if the Docker host IP is not a local address,
143// indicating that Docker is running on a remote machine.

Callers 15

TestGetFreePortFunction · 0.92
GetXHGuiURLMethod · 0.92
TestHostDBPortFunction · 0.92
generateRouterComposeFunction · 0.92
NewBackdropSettingsFunction · 0.92
TestCustomGlobalConfigFunction · 0.92
RenderComposeYAMLMethod · 0.92

Calls 1

getDockerManagerInstanceFunction · 0.85

Tested by 7

TestGetFreePortFunction · 0.74
TestHostDBPortFunction · 0.74
TestCustomGlobalConfigFunction · 0.74
TestGetDockerIPFunction · 0.74