Need Help. how to set container source ip

I have many addresses in a ubuntu server.

There is a server need different source ip for registing, so i want set container network source.

how can i do ?

  • ubuntu 18.04
  • docker 18.03.1-ce
  • ipv6

You cannot, except if you use host networking, than you select the source address inside of your container yourself. But that is somewhat ugly. Can’t you just fix the issue on the other end?


I using host networking(–net=host) now, and del the address registed already when new service registing.

Then add the address after registed.

It’s not a good way.