0

On my computer I have :

NETWORK ID          NAME                DRIVER              SCOPE
661118d67505        Default Switch      ics                 local
eae6a3536ef1        nat                 nat                 local
9d0b1f0209f6        none                null                local

but on the server I just created it installed a bridge network.

I need to create this bridge but don't know what IPs to specify? How can I view the hosts file on the server to see how it is configured?

NEW EDIT

I found that I could run docker network inspect bridge on the other computer to see how it was configured.

That answered one question.

Then, I uninstalled docker and reinstalled. When I ran the docker network ls again I got :

NETWORK ID          NAME                DRIVER              SCOPE
b490355c4a0c        bridge              bridge              local
d64dcade1e83        host                host                local
f7dd78a787db        none                null                local

I now how the bridge network on my computer. But: now, when I run the docker network ls command on my computer, I get this error:

error during connect: Get http://127.0.0.1:2375/v1.40/networks: dial tcp 127.0.0.1:2375: connectex: No connection could be made because the target machine actively refused it

I am forced to use the EXPOST DAEMON under general settings.

Then, I opened my VS2019 project and was told that DOCKER was configured to use LINUX and asked if I wanted to switch to windows. When I said yes, it reconfigured my networks back to what I had originally. I am so confused?

Do I need to run DOCKER with windows config (I imagine I do since I am publishing a .NET API)... if that is the case, what should my networking be? Please help !

Ethernet adapter vEthernet (**Default Switch**):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::6d5e:5403:3483:35e0%21
   IPv4 Address. . . . . . . . . . . : 172.17.17.161
   Subnet Mask . . . . . . . . . . . : 255.255.255.240
   Default Gateway . . . . . . . . . :

from IPCONFIG...

Please note: this entire question is to help solve this other question.

Chris Dunlop
  • 135
  • 1
  • 13
  • You almost never need to worry about the container-internal IP addresses; in a variety of common contexts you can't directly reach them, and Docker manages them for you. Similarly, Docker provides an internal DNS service to containers, so there is no hosts file _per se_. If these details do matter to you, manually `docker network create` a network with the settings you need. – David Maze Jul 07 '20 at 15:48
  • See above edit. – Chris Dunlop Jul 07 '20 at 17:01
  • I'd guess Docker for Windows is now using WSL2 by default, and when you did the "switch to windows" thing you reverted to the "old" Docker. I don't know much about docker for windows though, so I'm not too sure how things would add up. – Leonardo Dagnino Jul 07 '20 at 20:13

2 Answers2

1

Not sure I fully understand your question , but by default containers connect to the default bridge network: $ docker network ls to see it , usually ifconfig shows it as docker0.

Here you can find more info concerning docker network driver types: https://docs.docker.com/network/

dejanualex
  • 3,872
  • 6
  • 22
  • 37
  • I am running/deploying a windows API. As soon as I switch from a LINUX based container to a WINDOWS based container I lose the bridge. – Chris Dunlop Jul 07 '20 at 17:45
0

I've encountered the same issue when unsing Windows Container. What the docker network ls shows is as yours. But if I switch to Linux Container, the bride and host networks appears. So I guess the Windows and Linux Containers has different default settings for network

Lee Liya
  • 11
  • 1