I have read other questions like this and this, but did not got my answer.
I ran this:
docker run -dp 192.168.43.80:80:80 nginx:beta-1
But I got this error:
docker: Error response from daemon: driver failed programming external connectivity on endpoint hardcore_babbage (aa327aefe662c502bbc79d01660c166198f9a08ad588cd946a794e02b0b07dc4): Error starting userland proxy: listen tcp4 192.168.43.86:80: bind: cannot assign requested address.
And I searched for this error but got nothing.
ip a
:
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 08:00:27:2d:eb:7f brd ff:ff:ff:ff:ff:ff
inet 192.168.43.85/24 brd 192.168.43.255 scope global dynamic enp0s3
valid_lft 3060sec preferred_lft 3060sec
I use Oracle VirtualBox with three Linux VMs, and all of them has IP 192.168.43.0/24
.
I want to run a container that would be accessible via another IP like 192.168.43.80
from the VM which enp0s3
's IP is 192.168.43.85
. Both with docker run
command and docker-compose
.
What should I do in this case?