Skip to content

Commit

Permalink
Merge pull request #251 from GoSecure/fix-docker-missing-pyav-dep
Browse files Browse the repository at this point in the history
pyrdp-convert.py fixes for #250
  • Loading branch information
obilodeau committed Oct 7, 2020
2 parents 1f9f36a + 0a68553 commit edfcb2e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand All @@ -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 \
Expand All @@ -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/*
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down
20 changes: 20 additions & 0 deletions docs/devel.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<tag>` is replaced with previous release's tag:
+
Expand Down
6 changes: 5 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,14 +11,17 @@ 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
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
Expand Down

0 comments on commit edfcb2e

Please sign in to comment.