If you run the container from the console, you can do it as follows
docker run -d --name iperf_srv --network mynet --ip 10.195.10.10 astotal/iperf3 -s How to run a container on a specific IP using python api?
There is such a code, but how to specify a specific address, I could not figure out
import docker doc = docker.from_env() srv_pool=docker.types.IPAMPool(subnet='10.195.10.0/24',iprange='10.195.10.0/24') srv_ipam=docker.types.IPAMConfig(pool_configs=[srv_pool]) doc.networks.create('uplink', driver='macvlan', options={'parent':'eth2.3200'},ipam=srv_ipam) srv=doc.containers.run('astotal/iperf3', '-s', network='uplink', detach=True, name='iperf_server') The container starts up, but the IP is taken from the pool.