why? - because i was using community materials for ages but have not brought anything to it yet.
Docker creates bridge network by default like “docker0” and your container will be accessable through the LAN (using your host IP address) if you exposed some port.
I faced with one simple requirement to attach another IP address to docker container, i watched plenty of videos and tutorials which costed me lots of time and purging docker.io and i still was not able to meet that requirement, drivers like MACVLAN and etc either has not been recognized in proper way by a system and something like that so i decided to go aside of docker tools, simple steps:
/etc/network/interfaces (add-create sub interface)
iface enp0s31f67:1 inet static
address 10.10.10.18 #desired IP
restart the network
docker network create \
-o “com.docker.network.bridge.host_binding_ipv4”=“10.10.10.18” \
#Will create network with default behavior (bridge)
And, finally, attach some container to your “customnetwork” while starting container:
docker run \
–name container \
-p 80:80 \
–net customnetwork \
After those simple steps you WILL be able to reach your container from any workstation in your LAN and from your host as well, please note, ip address 10.10.10.18 shoud be aside of dhcp pool of your router.