Coder Social home page Coder Social logo

docker-plugin-hostnic's Introduction

docker-plugin-hostnic

docker-plugin-hostnic is a docker network plugin which can binding a special host nic to a container.

QuickStart

  1. Make sure you are using Docker 1.9 or later (test with 1.12)

  2. Build docker-plugin-hostnic and run, or directly run docker-plugin-hostnic docker image.

    docker pull qingcloud/docker-plugin-hostnic

    docker run -v /run/docker/plugins:/run/docker/plugins -v /etc/docker/hostnic:/etc/docker/hostnic --network host --privileged qingcloud/docker-plugin-hostnic docker-plugin-hostnic

  3. Create hostnic network,the subnet and gateway argument should be same as hostnic.

    docker network create -d hostnic --subnet=192.168.1.0/24 --gateway 192.168.1.1 hostnic

  4. Run a container and binding a special hostnic. Mac-address argument is for identity the hostnic. Please ensure that the ip argument do not conflict with other hostnic.

    docker run -it --ip 192.168.1.5 --mac-address 52:54:0e:e5:00:f7 --network hostnic ubuntu:14.04 bash

Additional Notes:

  1. If the ip argument is not passed when running container, docker will assign a ip to the container, so please pass the ip argument and ensure that the ip do not conflict with other hostnic.
  2. Network config will save to /etc/docker/hostnic/config.json,if plugin container removed and create again, network config can recover from the config.
  3. If your host only have one nic, please not use this plugin. If you binding the only one nic to container, your host will lost network.

docker-plugin-hostnic's People

Contributors

jolestar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.