diff --git a/Dockerfile b/Dockerfile index 11199d614..b886fb683 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ # Handles compiling and package installation -FROM ubuntu:18.04 AS compile-image +FROM ubuntu:20.04 AS compile-image # Install build dependencies +ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends \ python3 python3-pip \ # Required for local pip install @@ -9,7 +10,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ python3-venv \ # Required to build RLE module and dbus-python (GUI) build-essential python3-dev \ - libdbus-1-dev libdbus-glib-1-dev + libdbus-1-dev libdbus-glib-1-dev \ + # Required to build PyAV (pyrdp-convert to MP4) + libavformat-dev libavcodec-dev libavdevice-dev \ + libavutil-dev libswscale-dev libswresample-dev libavfilter-dev + RUN python3 -m venv /opt/venv # Make sure we use the virtualenv: @@ -31,9 +36,10 @@ RUN cd /pyrdp \ # Handles runtime only (minimize size for distribution) -FROM ubuntu:18.04 AS docker-image +FROM ubuntu:20.04 AS docker-image # Install runtime dependencies except pre-built venv +ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends python3 \ # To generate certificates openssl \ @@ -42,6 +48,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends python3 \ # GUI and notifications stuff libgl1-mesa-glx \ notify-osd dbus-x11 libxkbcommon-x11-0 \ + # Runtime requirement for PyAV (pyrdp-convert to MP4) + libavcodec58 libavdevice58 \ # Runtime requirement by progressbar (required by pyrdp-convert) python3-distutils \ && rm -rf /var/lib/apt/lists/* diff --git a/Dockerfile.slim b/Dockerfile.slim index 8097370c4..7a16e5074 100644 --- a/Dockerfile.slim +++ b/Dockerfile.slim @@ -3,8 +3,9 @@ # and notification system integration. # # Handles compiling and package installation -FROM ubuntu:18.04 AS compile-image +FROM ubuntu:20.04 AS compile-image # Install build dependencies +ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends \ python3 python3-pip \ # Required for local pip install @@ -32,9 +33,10 @@ RUN cd /pyrdp \ # Handles runtime only (minimize size for distribution) -FROM ubuntu:18.04 AS docker-image +FROM ubuntu:20.04 AS docker-image # Install runtime dependencies except pre-built venv +ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends python3 \ # To generate certificates openssl \ diff --git a/docs/devel.adoc b/docs/devel.adoc index 0fac9d6b3..8b5400c79 100644 --- a/docs/devel.adoc +++ b/docs/devel.adoc @@ -4,6 +4,26 @@ NOTE: This is a work in progress +.Update dependencies + +For developement and normal installation we rely on `setup.py` with loose dependencies. +For docker images we rely on `requirements.txt` and `requirements-slim.txt` with strict dependencies. +It is important to keep both approaches in sync and to peridiocally update the requirements files (like before releases). +See https://github.com/GoSecure/pyrdp/pull/219[the PR where we improved our use of the docker cache] for the reasoning behind this approach. + +In a clean tree, on master: + +* install and load the venv +* do a `pip freeze > requirements.txt` +* manually inspect updated dependencies +* copy over to `requirements-slim.txt` those that make sense (don't add av, PySide2, etc.) + +If you are unsure about which to keep and which to discard between `requirements.txt` and `requirements-slim.txt`, just look at a diff of a previous version. + +.Test + +docker images (latest, slim), on linux, on Windows + .Update the changelog * You can generate author list with where `` is replaced with previous release's tag: + diff --git a/requirements.txt b/requirements.txt index 4e88cb76f..2b6999744 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ appdirs==1.4.3 attrs==19.3.0 Automat==20.2.0 +av==8.0.2 cffi==1.14.0 constantly==15.1.0 cryptography==2.9 @@ -10,7 +11,9 @@ idna==2.9 incremental==17.5.0 names==0.3.0 notify2==0.3.1 -progressbar2==3.51.3 +Pillow==7.2.0 +pillowcase==2.0.0 +progressbar2==3.51.4 pyasn1==0.4.8 pyasn1-modules==0.2.8 pycparser==2.20 @@ -18,6 +21,7 @@ pycryptodome==3.9.7 PyHamcrest==2.0.2 pyOpenSSL==19.1.0 PySide2==5.14.2 +python-utils==2.4.0 pytz==2019.3 rsa==4.0 scapy==2.4.3