Как сделать контейнер docker работающим в той же локальной сети, что и мой локальный хост?

#docker #moby

Вопрос:

Я пытаюсь создать контейнер докеров, работающий в той же локальной сети, что и мой локальный хост, чтобы nmap мог успешно сканировать устройство локальной сети.

Однако, когда я выполнил эти действия ниже, я не смог найти MobyLinux.ps1 в пути X:Program ФайлыОкно настройкиОкно настройкиресурсы.

Я что-то пропустил? Спасибо!

 Windows 10 PROFESSIONAL/ENTERPRISE

**Create vSwitch with physical network adapter**

1. Open Hyper-V Manager
2. Action list- > Open Virtual Switch Manager
3. Create new virtual switch -> select Type: External
4. Assign your physical network adapter to the vSwitch
5. Check "Allow management operating system to share this network adapter" and apply change
6. Go to Control PanelAll Control Panel ItemsNetwork Connections.
7. Check the vEthernet you just created, and make sure the IPV4 setting is correct. (sometimes the dhcp setting will be empty and you need to reset again here)
8. Go back to Hyper-V Manager, and go into Setting page of MobyLinuxVM (ensure it's shut down, if it's not, Quit Docker)
9. Add Hardware > Network Adapter, select the vSwitch you just created and apply change

**Modify Docker source code**

1. Find the MobyLinux creation file: MobyLinux.ps1 (normally it's located at: X:Program FilesDockerDockerresources)
2. Edit the file, and find the function: function New-MobyLinuxVM
3. Find below line in the function: $vmNetAdapter = $vm | Hyper-VGet-VMNetworkAdapter
Update it to: $vmNetAdapter = $vm | Hyper-VGet-VMNetworkAdapter | Select-Object -First 1
4. Save file by administrator
5. Restart Docker, and the container should run on the LAN now.
 

Окружающая среда:
ОПЕРАЦИОННАЯ система: Windows 10 Professional 20H2 19042.1110

Версия докера: Механизм Докера — Сообщество V20.10.7 (серверная часть Hyper-V)

ссылка:
https://hub.docker.com/r/qtimmylin/evt_платформа/