diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index c3124078b..97166a6f0 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -42,6 +42,12 @@ jobs: steps: - name: Check out the repo uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 - name: Log in to Docker Hub uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 @@ -62,6 +68,7 @@ jobs: with: context: . file: Dockerfile.slim + platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile.slim b/Dockerfile.slim index 6cb8df3a6..93719a0cb 100644 --- a/Dockerfile.slim +++ b/Dockerfile.slim @@ -14,14 +14,25 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Required for venv setup python3-venv \ # Required to build RLE module - build-essential python3-dev + build-essential python3-dev \ + # Required for ARM builds (because we need to build cryptography instead of using a prebuilt wheel) + libssl-dev libffi-dev RUN python3 -m venv /opt/venv # Make sure we use the virtualenv: ENV PATH="/opt/venv/bin:$PATH" +# Required for ARM builds +# Building dependencies didn't work without an upgraded pip and wheel on ARM +RUN pip3 --no-cache-dir install -U pip wheel + # Install dependencies only (speeds repetitive builds) COPY requirements-slim.txt /pyrdp/requirements.txt +# The following allows us to install the cryptography package. +# Eventually we will add rust to our compile-image and build with rust but +# rust's cargo is broken on docker ARM right now and we will wait until +# upstream is fixed. +ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1 RUN cd /pyrdp && pip3 --no-cache-dir install -r requirements.txt # Compile only our C extension and install diff --git a/README.md b/README.md index 0988daf12..0563f4517 100644 --- a/README.md +++ b/README.md @@ -76,10 +76,10 @@ research use cases in mind. ## Supported Systems -PyRDP should work on Python 3.6 and up. +PyRDP should work on Python 3.6 and up on the x86-64, ARM and ARM64 platforms. -This tool has been tested to work on Python 3.6 on Linux (Ubuntu 18.04) and Windows (See section [Installing on -Windows](#installing-on-windows)). It has not been tested on OSX. +This tool has been tested to work on Python 3.6 on Linux (Ubuntu 18.04), Raspberry Pi and Windows +(see section [Installing on Windows](#installing-on-windows)). It has not been tested on macOS. ## Installing @@ -92,6 +92,7 @@ docker pull gosecure/pyrdp:latest ``` As an alternative we have a slimmer image without the GUI and ffmpeg dependencies. +This is the only provided image on ARM platforms. ``` docker pull gosecure/pyrdp:latest-slim @@ -224,6 +225,12 @@ docker build -f Dockerfile.slim -t pyrdp . Afterwards, you can execute PyRDP by invoking the `pyrdp` docker container. See [Usage instructions](#using-pyrdp) and the [Docker specific instructions](#docker-specific-usage-instructions) for details. +Cross-platform builds can be achieved using `buildx`: + +``` +docker buildx build --platform linux/arm,linux/amd64 -t pyrdp -f Dockerfile.slim . +``` + ### Migrating away from pycrypto Since pycrypto isn't maintained anymore, we chose to migrate to pycryptodome. If you get this error, it means that you are using the module pycrypto instead of pycryptodome.