How do I deploy Docker containers on separate public IP addresses?
Linode
Linode Staff
I'm trying to run multiple containers on separate public IP addresses. I have multiple public IPs on my Linode. How do I assign a container to a specific IP address?
1 Reply
tommydavidson
Linode Staff
You can specify the IP address on which to run a Docker container along with the port when deploying it. For example, to deploy a container on port 80 of 12.34.56.78
, you could run:
docker -d -p 12.34.56.78:80:80
This tells docker to run the container on 12.34.56.78
, and to re-direct requests from the host's port 80 to the container's port 80.