docker-windows/README.md

33 lines
1.3 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Before doing the docker compose up always use the command
1) Create a macvlan network for the containers
Pick a tiny slice of your LAN that you wont use for normal devices; well use .200.206.
# stop your current containers first
docker compose down
# create the macvlan network (parent is your NIC thats on 192.168.10.0/24)
# \\ here remember that you have to set the subnet gateway ip-range and the parent with your network configuration
docker network create -d macvlan \
--subnet=192.168.10.0/24 \
--gateway=192.168.10.1 \
--ip-range=192.168.10.200/29 \
-o parent=enp6s0 \
ad_vlan
Why: macvlan lets each container appear as its own L2 host on your 192.168.10.0/24.
2) Allow the host to talk to macvlan endpoints (host-access workaround)
macvlan blocks host↔container by design. Create a macvlan sub-interface on the host so Arch can reach them:
# create a host-side macvlan interface that shares the same parent
sudo ip link add adhost link enp6s0 type macvlan mode bridge
sudo ip addr add 192.168.10.9/24 dev adhost
sudo ip link set adhost up
# route the small pool via this host-side macvlan interface
sudo ip route add 192.168.10.200/29 dev adhost
Now your Arch host (192.168.10.10) can reach the macvlan IPs through adhost (192.168.10.9).