Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building docker images for ARM #346

Merged
merged 4 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
13 changes: 12 additions & 1 deletion Dockerfile.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down