Skip to content

Commit

Permalink
Merge pull request #346 from GoSecure/docker-arm
Browse files Browse the repository at this point in the history
Building docker images for ARM
  • Loading branch information
obilodeau authored Aug 19, 2021
2 parents 7a295f3 + 79cb130 commit df1dce9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
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

0 comments on commit df1dce9

Please sign in to comment.