Docker swarm — container binding to ethx IP

I’m really a docker newbie, please forgive my lack of skills on specifying questions.

Now I’ve met a scene in production where I’d like to use docker swarm to connect different machines together in a docker network.

  • How do get docker working after software installation?
  • Docker Elasticsearch Plugin with Request
  • Pushing a Docker image with gcloud failed
  • Updating a Symfony app with Docker-compose without losing data
  • Docker Backup and restore postgres
  • Docker registry: Can't find image
  • But each host machine may have multiple physical NIC(eth0, eth1, etc…), thus different IPs, and each time I orchestrate the system, I’d like to initialize a new network for each container, letting the container use a particular IP among NIC’s IP. But each container using the IP of each NIC, not under docker0.

    I’ve read the doc on docker 17.06ce mentioning using DOCKER-USER flag, but I can’t quite understand that.

    Using host network is not the best option for me because that will occupy the port globally.
    Thanks in advance.

  • Access Docker socket within container
  • How do I expose ports in Docker on Windows 10?
  • Localhost inside docker - neo4j
  • Atlassian Application Links Inside Docker
  • Docker API port binding is not working
  • How do I restart a Docker container/image/machine?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.