Problem scenario
How do you create Docker containers to have unique IP Addresses (but not the default 172.x.x.x type)?
Solution
(If you need help installing Docker, see this posting.)
Create new IP addresses with these commands (with sudo in front of them, preferably, or less preferably as the root user):
ip addr add 33.33.33.38/28 brd + dev eth0
ip addr add 33.33.33.39/28 brd + dev eth0
ip addr add 33.33.33.40/28 brd + dev eth0
# Replace the IP addresses and subnet masks as you desire
Then use a modified version of this command:
docker run -p 33.33.33.38:80:80 repositoryName:versionDesignation /bin/bash
# You can use the “docker images” command to find the “repositoryName” and “versionDesignation”
# The IP address and port mapping (from Linux server to Docker container) can be substituted as needed
Two or more containers on the same Docker host can use port 80 using this method.
…
Continue reading “How Do You Create Docker Containers To Have Unique IP Addresses?”