|
怎么说呢?你还是没看明白,你的net是bridge,你又给了ip地址,你的ip地址和bridge不在同一网段啊!!!!你要真想看明白,作者的docker hub页面有详细的介绍,https://hub.docker.com/r/vdsm/virtual-dsm
你需要先创建macvlan,母网络是默认的eth0,这个要改,你要ip a看一下自己的网卡
具体如下吧
How do I assign an individual IP address to the container?
By default, the container uses bridge networking, which shares the IP address with the host.
If you want to assign an individual IP address to the container, you can create a macvlan network as follows:
docker network create -d macvlan \
--subnet=192.168.0.0/24 \
--gateway=192.168.0.1 \
--ip-range=192.168.0.100/28 \
-o parent=eth0 vdsm
Be sure to modify these values to match your local subnet.
Once you have created the network, change your compose file to look as follows:
services:
dsm:
container_name: dsm
..<snip>..
networks:
vdsm:
ipv4_address: 192.168.0.100
networks:
vdsm:
external: true
An added benefit of this approach is that you won't have to perform any port mapping anymore, since all ports will be exposed by default. |
|