pyveth - veth driver for Docker Engine written in Python
Jacek Kowalski
2020-05-22 50a46b5cf11317d12d872b54ecd276ede52d5d0c
Replace uwsgi with waitress due to 400 Bad Request issues
1 files deleted
4 files modified
32 ■■■■■ changed files
Dockerfile 4 ●●●● patch | view | raw | blame | history
config.json 6 ●●●● patch | view | raw | blame | history
requirements.txt 1 ●●●● patch | view | raw | blame | history
run.py 5 ●●●●● 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" ]
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__':
    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