diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 13bbeba..439396a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,7 +16,7 @@ on: env: DOCKER_REPO: shenxn/protonmail-bridge DOCKER_REPO_DEV: ghcr.io/shenxn/protonmail-bridge-dev - PLATFORMS: linux/amd64,linux/arm64/v8 + PLATFORMS: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/riscv64 jobs: build: diff --git a/.gitignore b/.gitignore index e69de29..366d839 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,3 @@ +# Ignoring IDE-specific files +.idea/* +.vscode diff --git a/README.md b/README.md index 389e6b7..5d02b8f 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,6 @@ Docker Hub: [https://hub.docker.com/r/shenxn/protonmail-bridge](https://hub.dock GitHub: [https://github.com/shenxn/protonmail-bridge-docker](https://github.com/shenxn/protonmail-bridge-docker) -## ARMv7 Builds - -Currently there is a problem building the new parser targeting 32-bit architectures (i.e. `arm/v7`). The latest working build is `1.4.5-build`. Therefore, if you are using an `arm/v7` device like Raspberry Pi, do not upgrade to newer version. More information about the problem can be found [here](https://www.reddit.com/r/ProtonMail/comments/jvzm12/issue_building_bridge_150/). If you have any idea on how to fix this, a PR is welcome. - ## ARM Support We now support ARM devices (`arm64` and `arm/v7`)! Use the images tagged with `build`. See next section for details. @@ -24,7 +20,7 @@ We now support ARM devices (`arm64` and `arm/v7`)! Use the images tagged with `b There are two types of images. - `deb`: Images based on the official [.deb release](https://protonmail.com/bridge/install). It only supports the `amd64` architecture. - - `build`: Images based on the [source code](https://github.com/ProtonMail/proton-bridge). It supports `amd64`, `arm64`, and `arm/v7`. Supporting to more architectures is possible. PRs are welcome. + - `build`: Images based on the [source code](https://github.com/ProtonMail/proton-bridge). It supports `amd64`, `arm64`, `arm/v7` and `riscv64`. Supporting to more architectures is possible. PRs are welcome. tag | description -- | -- diff --git a/build/Dockerfile b/build/Dockerfile index 439e831..65dbe93 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,14 +1,15 @@ -FROM golang:1.15 AS build +# Use carlosedp/golang for riscv64 support +FROM carlosedp/golang:1.18 AS build # Install dependencies -RUN apt-get update && apt-get install -y libsecret-1-dev +RUN apt-get update && apt-get install -y git build-essential libsecret-1-dev # Build WORKDIR /build/ COPY build.sh VERSION /build/ RUN bash build.sh -FROM ubuntu:bionic +FROM ubuntu:focal LABEL maintainer="Xiaonan Shen " EXPOSE 25/tcp @@ -23,6 +24,7 @@ RUN apt-get update \ COPY gpgparams entrypoint.sh /protonmail/ # Copy protonmail +COPY --from=build /build/proton-bridge/bridge /protonmail/ COPY --from=build /build/proton-bridge/proton-bridge /protonmail/ # Add a user 'protonmail' with UID 8535 diff --git a/build/VERSION b/build/VERSION index d2c4b27..b38ebbf 100644 --- a/build/VERSION +++ b/build/VERSION @@ -1 +1 @@ -1.8.7 \ No newline at end of file +3.0.4 \ No newline at end of file diff --git a/build/build.sh b/build/build.sh index 05903bf..91f2772 100644 --- a/build/build.sh +++ b/build/build.sh @@ -9,5 +9,15 @@ git clone https://github.com/ProtonMail/proton-bridge.git cd proton-bridge git checkout v$VERSION +ARCH=$(uname -m) +if [[ $ARCH == "armv7l" ]] ; then + # This is expected to fail, and we use the following patch to fix + make build-nogui || true + # For 32bit architectures, there was a overflow error on the parser + # This is a workaround for this problem found at: + # https://github.com/antlr/antlr4/issues/2433#issuecomment-774514106 + find $(go env GOPATH)/pkg/mod/github.com/\!proton\!mail/go-rfc5322*/ -type f -exec sed -i.bak 's/(1<