moby / moby

The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
https://mobyproject.org/
Apache License 2.0
68.56k stars 18.64k forks source link

docker: Error response from daemon: network host not found. #38166

Open Jasonjeba opened 5 years ago

Jasonjeba commented 5 years ago

Description

Steps to reproduce the issue:

  1. I am in a windows container
  2. Just type the command in cmd "docker run --rm -it --net=host landoop/fast-data-dev bash"

Describe the results you received: docker: Error response from daemon: network host not found.

Describe the results you expected: I was not able to login to bash

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version: Client: Version: 18.06.1-ce API version: 1.38 Go version: go1.10.3 Git commit: e68fc7a Built: Tue Aug 21 17:21:34 2018 OS/Arch: windows/amd64 Experimental: false

Server: Engine: Version: 18.06.1-ce API version: 1.38 (minimum version 1.24) Go version: go1.10.3 Git commit: e68fc7a Built: Tue Aug 21 17:36:40 2018 OS/Arch: windows/amd64 Experimental: true

Output of docker info: Containers: 4 Running: 1 Paused: 0 Stopped: 3 Images: 7 Server Version: 18.06.1-ce Storage Driver: windowsfilter (windows) lcow (linux) Windows: LCOW: Logging Driver: json-file Plugins: Volume: local Network: ics l2bridge l2tunnel nat null overlay transparent Log: awslogs etwlogs fluentd gelf json-file logentries splunk syslog Swarm: inactive Default Isolation: hyperv Kernel Version: 10.0 17134 (17134.1.amd64fre.rs4_release.180410-1804) Operating System: Windows 10 Enterprise Version 1803 (OS Build 17134.345) OSType: windows Architecture: x86_64 CPUs: 4 Total Memory: 3.882GiB Name: JASON ID: FCE5:MGHA:7TXG:UNVR:BYWV:NFEV:WW7W:4NLY:4YTO:TNOV:PMVA:EHKH Docker Root Dir: C:\ProgramData\Docker Debug Mode (client): false Debug Mode (server): true File Descriptors: -1 Goroutines: 46 System Time: 2018-11-09T22:17:47.0531029+05:30 EventsListeners: 2 Registry: https://index.docker.io/v1/ Labels: Experimental: true Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

docker: Error response from daemon: network host not found. Additional environment details (AWS, VirtualBox, physical, etc.):

Jasonjeba commented 5 years ago

@simplesteph please help

thaJeztah commented 5 years ago

I don't think "host" networking is supported for Windows containers

@jhowardmsft

thaJeztah commented 5 years ago

The list of supported network drivers is shown in docker info;

Network: ics l2bridge l2tunnel nat null overlay transparent
lowenna commented 5 years ago

One for the networking team. I think transparent is the "closest" to Linux's host networking, but it doesn't really share the host networking stack. Instead it looks like another device on the network. @jmesser81

Jasonjeba commented 5 years ago

The list of supported network drivers is shown in docker info;

Network: ics l2bridge l2tunnel nat null overlay transparent

can you please tell me . How to run the above commands( "docker run --rm -it --net=host landoop/fast-data-dev bash" ) with the networks you mentioned @jhowardmsft @thaJeztah

thaJeztah commented 5 years ago

@Jasonjeba you can't with Windows containers; --net=host is a Linux feature. As @jhowardmsft mentions above, the network driver that comes closest to host network on Linux is probably --net=transparent

Jasonjeba commented 5 years ago

@Jasonjeba you can't with Windows containers; --net=host is a Linux feature. As @jhowardmsft mentions above, the network driver that comes closest to host network on Linux is probably --net=transparent

@thaJeztah i tried with transparent, but it didn't work.. i was able to connect as "net=nat".. can you please provide more info about nat. Now after connection i can see this error in logs. "curl: (7) Failed to connect to localhost port 8081: Connection refused"

lowenna commented 5 years ago

@daschott - Can you follow-up/update docs/close-out as appropriate.

lowenna commented 5 years ago

ping @daschott

daschott commented 5 years ago

@Jasonjeba regarding NAT network mode, here are a few docs: https://techcommunity.microsoft.com/t5/Virtualization/Windows-NAT-WinNAT-Capabilities-and-limitations/ba-p/382303 https://docs.microsoft.com/en-us/virtualization/windowscontainers/container-networking/network-drivers-topologies

Host network mode on Windows isn't supported unfortunately.... Is there a particular reason you would need host network mode, or a limitation of the other network drivers described in the above docs?

andrejbratukhin commented 5 years ago

@Jasonjeba regarding NAT network mode, here are a few docs: https://techcommunity.microsoft.com/t5/Virtualization/Windows-NAT-WinNAT-Capabilities-and-limitations/ba-p/382303 https://docs.microsoft.com/en-us/virtualization/windowscontainers/container-networking/network-drivers-topologies Host network mode on Windows isn't supported unfortunately.... Is there a particular reason you would need host network mode, or a limitation of the other network drivers described in the above docs?

I think Jasonjeba wanted to access a LAN resource from a Windows container. Is it possible to do it?

daschott commented 4 years ago

Sorry for the delay here - yes, I don't see why not?