https://github.com/dataman-cloud/p2pull
Peer-to-peer push/pull between docker hosts on beijing #dockerhackday
https://github.com/dataman-cloud/p2pull
Last synced: about 2 months ago
JSON representation
Peer-to-peer push/pull between docker hosts on beijing #dockerhackday
- Host: GitHub
- URL: https://github.com/dataman-cloud/p2pull
- Owner: Dataman-Cloud
- Created: 2015-09-19T02:08:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-20T08:04:45.000Z (over 9 years ago)
- Last Synced: 2025-04-03T12:46:58.754Z (2 months ago)
- Language: Go
- Size: 16.6 MB
- Stars: 25
- Watchers: 38
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# p2pull
Peer-to-peer push/pull between docker hosts on beijing #dockerhackday# Member
* Xiao Deshi
* Yao Yun
* Zhang Mingfeng## How to make it work
generating the server certificate and private key with OpenSSL takes just one
command:
```
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout key.pem -out
cert.pem
```registry to make it work with p2p easily.
Let's run tracker on `192.168.0.1` (`host1`) and proxies on `192.168.0.{2,3,4}` (`host{2,3,4}`).
```
host1> docker run -d --net=host bobrik/bay-tracker \
-listen 192.168.0.1:8888 -tracker 192.168.0.4:6881 -root /tmp
```Now let's run local proxies on each box:
```
host2> docker run -d -p 127.0.0.1:80:80 bobrik/bay-proxy \
-tracker http://192.168.0.1:8888/ -listen :80 -root /tmphost3> docker run -d -p 127.0.0.1:80:80 bobrik/bay-proxy \
-tracker http://192.168.0.1:8888/ -listen :80 -root /tmphost4> docker run -d -p 127.0.0.1:80:80 bobrik/bay-proxy \
-tracker http://192.168.0.1:8888/ -listen :80 -root /tmp
```In `/etc/hosts` on each machine add the next record:
```
127.0.0.1 p2p-
```where `my-registry.com` should be your usual registry.
After that on `host{2,3,4}` you can run:
```
docker pull p2p-/myimage
```and it will work just like
```
docker pull /myimage
```but with p2p magic and unicorns.
# Thanks
https://github.com/bobrik/bay