pyveth - veth driver for Docker Engine written in Python
8c0fc507499360bce22bd30a1edb1d0c81ffe1f9..e2cff67419aa5d55b143ddea7f25b7ff0ca77e28
2020-05-22 Jacek Kowalski
Add build badge and Docker Hub URL to README
e2cff6 diff | tree
2020-05-22 Jacek Kowalski
Replace uwsgi with waitress due to 400 Bad Request issues
50a46b diff | tree
1 files deleted
5 files modified
43 ■■■■ changed files
Dockerfile 4 ●●●● patch | view | raw | blame | history
README.md 9 ●●●●● patch | view | raw | blame | history
config.json 6 ●●●● patch | view | raw | blame | history
requirements.txt 1 ●●●● patch | view | raw | blame | history
run.py 7 ●●●● patch | view | raw | blame | history
uwsgi.ini 16 ●●●●● patch | view | raw | blame | history
Dockerfile
@@ -1,6 +1,6 @@
FROM alpine
RUN apk add uwsgi-python3 python3 py3-pip
RUN apk add python3 py3-pip
RUN mkdir -p /run/docker/plugins /usr/src/app \
    && chown -R nobody:nobody /run/docker/plugins /usr/src/app
USER nobody
@@ -12,4 +12,4 @@
COPY --chown=nobody:nobody . .
CMD [ "uwsgi", "--ini", "uwsgi.ini" ]
CMD [ "./run.py" ]
README.md
@@ -6,9 +6,12 @@
It should be a drop-in replacement for macvlan module.
![Build status](https://github.com/jacekkow/docker-plugin-pyveth/workflows/Release/badge.svg)
## Installation
Plugin is packaged as [Docker Engine-managed plugin](https://docs.docker.com/engine/extend/).
Check out [plugin page on Docker Hub](https://hub.docker.com/p/jacekkow/pyveth).
To install it simply run:
@@ -28,12 +31,14 @@
One will be pushed inside the container and another will remain on host
(without any IP assigned).
Plugin accepts optional `parent` parameter, which is be a name of bridge
Plugin accepts optional `parent` parameter, which is a name of bridge
interface that the second interface should be added to:
```bash
docker network create --driver jacekkow/pyveth:latest --opt parent=br0 new-network
```
This way host interface will be automatically attached to the specified bridge.
## Manual packaging
@@ -42,5 +47,3 @@
You can also use `package.sh` helper script which will perform
all the steps (including installation) automatically.
config.json
@@ -2,9 +2,13 @@
    "description": "pyveth - veth network driver in Python",
    "documentation": "https://github.com/jacekkow/docker-plugin-pyveth",
    "workdir": "/usr/src/app",
    "entrypoint": ["uwsgi", "--ini", "uwsgi.ini"],
    "entrypoint": ["./run.py"],
    "env": [
        {
            "name": "ENVIRONMENT",
            "value": "production"
        },
        {
            "name": "HOME",
            "value": "/usr/src/app"
        }
requirements.txt
@@ -1,3 +1,4 @@
docker-plugin-api>=0.3
Flask
pyroute2
waitress
run.py
@@ -1,9 +1,11 @@
#!/usr/bin/env python3
import logging
import os
import docker_plugin_api.Plugin
import flask
import waitress
app = flask.Flask('pyveth')
app.logger.setLevel(logging.DEBUG)
@@ -15,4 +17,7 @@
app.register_blueprint(lib.NetworkDriver.app)
if __name__ == '__main__':
    app.run(debug=True)
    if os.environ.get('ENVIRONMENT', 'dev') == 'dev':
        app.run(debug=True)
    else:
        waitress.serve(app, unix_socket='/run/docker/plugins/pyveth.sock', threads=1)
uwsgi.ini
File was deleted