Run container on specific IP
See original GitHub issueHi! Could you explain me how to run container on a specific IP?
If I run from console I execute this command:
docker run -d --name iperf_srv --network mynet --ip 10.195.10.10 astotal/iperf3 -s
So how can reach the same result with python API?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10
Top Results From Across the Web
Assign static IP to Docker container - Stack Overflow
This command will run a Docker container with a random IP like 172.17.0.5, but I need to assign a specific IP to the...
Read more >Binding a container to a specific IP address - Learning Docker
Binding a container to a specific IP address ... Here, the IP address must be a valid IP address on the Docker host....
Read more >How to Assign a Static IP to a Docker Container - How-To Geek
Static IP addresses don't change when containers or services are stopped and started, making them useful for permanent networking.
Read more >Container networking - Docker Documentation
When you connect an existing container to a different network using docker network connect , you can use the --ip or --ip6 flags...
Read more >Manually Specifying the IP Address of a Container
You can specify an IP address and a network explicitly, using Classless Inter-Domain Routing or CIDR notation. For example, we can launch a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found solution with a few inter steps
Thanks a lot!
According to the share of AStotal, I figured out how to use docker SDK to achieve the desired effect:
The name of ‘network’ in method ‘create’, be sure to match the name in ‘networks.get’.Only in this way can the perfect setting be successful.(In the equivalent shell command: ‘–network mynet --ip 10.195.10.10’) Otherwise, there will be two virtual network cards ‘eth0’ and ‘eth1’ in the new container. ‘eth0’ is the default network card of docker, and ‘eth1’ is the network card and IP you set.
Thanks AStotal for sharing.