Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Tydus authored Oct 6, 2022
1 parent 7e5dfbd commit a778845
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# docker-plugin-hostnic

docker-plugin-hostnic is a docker network plugin which can binding a special host nic to a container.
It is *not recommended* to run it in container since it may cause dependency problem while restart docker daemon and make restarting *very slow*.
docker-plugin-hostnic is a docker network plugin which can binding a host nic to a container (conceptually similar to "PCI-E Passthrough" or "SR-IOV").

It is *not recommended* to run it in container since it may cause dependency problem while restarting docker daemon and make restarting *very slow*.

## QuickStart

1. Make sure you are using Docker 1.9 or later (test with 20.10.18)
2. Build docker-plugin-hostnic and run.

2. Build docker-plugin-hostnic and run the daemon.

```bash
go build -o docker-plugin-hostnic main.go
Expand All @@ -17,13 +19,13 @@ cp docker-plugin-hostnic /usr/local/sbin
3. Create hostnic network,the subnet and gateway argument should be same as hostnic.

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

4. Run a container and binding a special hostnic. We use `--mac-address` argument to identify the hostnic. Please ensure that the ip argument do not conflict with other container in the same network.
4. Run a container and binding a special hostnic. We use `--mac-address` argument to identify the hostnic. Please ensure that the `--ip` argument do not conflict with other container in the same network.

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

## Additional Notes:
Expand Down

0 comments on commit a778845

Please sign in to comment.