How do I deploy Docker containers on separate public IP addresses?

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

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.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct