1 files deleted
5 files modified
| | |
| | | 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 |
| | |
| | | |
| | | COPY --chown=nobody:nobody . . |
| | | |
| | | CMD [ "uwsgi", "--ini", "uwsgi.ini" ] |
| | | CMD [ "./run.py" ] |
| | |
| | | |
| | | 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: |
| | | |
| | |
| | | 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 |
| | | |
| | |
| | | |
| | | You can also use `package.sh` helper script which will perform |
| | | all the steps (including installation) automatically. |
| | | |
| | | |
| | |
| | | "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" |
| | | } |
| | |
| | | docker-plugin-api>=0.3 |
| | | Flask |
| | | pyroute2 |
| | | waitress |
| | |
| | | #!/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) |
| | |
| | | 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) |