I must be doing something totally wrong here, but I'm trying to test a simple setup of a docker container bound to a specific IP on the machine. Here's the use case:
On the host:
ifconfig eno1:1 192.168.3.222 netmask 255.255.255.0 up
docker network create --subnet=172.18.0.0/16 mynet123
docker run --net mynet123 --privileged -p 192.168.3.222:4444:4444 --name test -t -i ubuntu:xenial /bin/bash
In the bash session that is now running:
apt-get update
apt-get install netcat
netcat -l 4444
Now back on another shell on the host (or any other computer on the network):
netcat 192.168.3.222 4444
This gets a connection refused.
I must be doing something wrong, because even with I try it with the default network and -p 4444:4444
or with --net=host
and using the host's original IP instead of .222 the same thing occurs.
This seems so simple based on everything I've read online, but for some reason I can't make other machines able to access the container via the host.