From 142858283405689924c02d5ac95c57e8e695b659 Mon Sep 17 00:00:00 2001 From: Daniel Dolezal Date: Tue, 14 Oct 2025 16:35:46 +0200 Subject: [PATCH] use old build structure and update to golang 1.25 --- build/Dockerfile | 17 ++++++++--------- build/build.sh | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 build/build.sh diff --git a/build/Dockerfile b/build/Dockerfile index e90ff25..c0a3fc3 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,18 +1,18 @@ -# The build image could be golang, but it currently does not support riscv64. Only debian:sid does, at the time of writing. -FROM debian:sid-slim AS build +FROM golang:1.25 AS build ARG version # Install dependencies -RUN apt-get update && apt-get install -y golang build-essential libsecret-1-dev +RUN apt-get update && apt-get install -y build-essential libsecret-1-dev # Build ADD https://github.com/ProtonMail/proton-bridge.git#${version} /build/ WORKDIR /build/ -RUN make build-nogui vault-editor +COPY build.sh /build/ +RUN bash build.sh -FROM debian:sid-slim -LABEL maintainer="Simon Felding " +FROM ubuntu:jammy +LABEL maintainer="Xiaonan Shen " EXPOSE 25/tcp EXPOSE 143/tcp @@ -26,8 +26,7 @@ RUN apt-get update \ COPY gpgparams entrypoint.sh /protonmail/ # Copy protonmail -COPY --from=build /build/bridge /protonmail/ -COPY --from=build /build/proton-bridge /protonmail/ -COPY --from=build /build/vault-editor /protonmail/ +COPY --from=build /build/proton-bridge/bridge /protonmail/ +COPY --from=build /build/proton-bridge/proton-bridge /protonmail/ ENTRYPOINT ["bash", "/protonmail/entrypoint.sh"] diff --git a/build/build.sh b/build/build.sh new file mode 100644 index 0000000..f411d6e --- /dev/null +++ b/build/build.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -ex + +VERSION=`cat VERSION` + +# Clone new code +sed -i 's/127.0.0.1/0.0.0.0/g' internal/constants/constants.go + +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<