I'm running a Docker container with the MACVLAN network driver so the container has an IP address on my network. The container is running a NodeJS app on port 3001. I use the following command to run the Docker container:
docker run --net=vlan1 --ip=172.16.3.14 -p 172.16.3.14:80:3001 --name iptv-staging -t iptv-staging
The container starts up without issue and is accessible at 172.16.3.14, however only when I browse using :3001. It is not accessible via port 80 as mapped. docker container ls does not show ports for that container:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2aa1273ad7cd iptv-staging "node app.js" 10 minutes ago Up 10 minutes iptv-staging
Inspecting the Docker file seems to show the correct port mapping:
"PortBindings": {
"3001/tcp": [
{
"HostIp": "172.16.3.14",
"HostPort": "80"
}
]
},
I've also tried launching without the HostIP defined:
docker run --net=vlan1 --ip=172.16.3.14 -p 80:3001 --name iptv-staging -t iptv-staging
But with the same result. Not sure where I'm going wrong?