From f3e41a2856631f545b504f529a3ba63047a4de93 Mon Sep 17 00:00:00 2001 From: Michael Gibson Date: Thu, 3 Dec 2020 13:01:56 -0600 Subject: [PATCH 1/2] Fixed binary name, added RELEASE option. --- Dockerfile | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 17eaea5..307a4f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ FROM golang:1.14-alpine as build ENV LANG C.UTF-8 RUN apk add --no-cache \ + curl \ gcc \ git \ libsecret-dev \ @@ -9,11 +10,19 @@ RUN apk add --no-cache \ musl-dev WORKDIR /usr/src +ARG RELEASE ARG TAG -RUN git clone https://github.com/ProtonMail/proton-bridge.git proton-bridge \ - && cd proton-bridge \ - && if [ -n "$TAG" ]; then echo "Using tags/$TAG..."; git checkout tags/$TAG; fi \ - && make build-nogui +RUN if [ -n "$RELEASE" ]; then \ + echo "Using release $RELEASE..." \ + && curl -L -s "https://github.com/ProtonMail/proton-bridge/archive/$RELEASE.tar.gz" | tar zx \ + && ln -s "proton-bridge-$RELEASE" proton-bridge \ + && cd proton-bridge \ + ; else \ + git clone https://github.com/ProtonMail/proton-bridge.git proton-bridge \ + && cd proton-bridge \ + && if [ -n "$TAG" ]; then echo "Using tags/$TAG..."; git checkout tags/$TAG; fi \ + ; fi \ + && make build-nogui # Create a container for the ProtonMail Bridge. FROM alpine:edge @@ -22,7 +31,7 @@ ENV LANG C.UTF-8 EXPOSE 25/tcp EXPOSE 143/tcp -COPY --from=build /usr/src/proton-bridge/Desktop-Bridge /bin/protonmail-bridge +COPY --from=build /usr/src/proton-bridge/proton-bridge /bin/proton-bridge COPY entrypoint /bin/ COPY initproton /bin/ RUN apk add --no-cache \ From 30c93de13ea4ae593e1b1ef02e3bfe3163bf21f8 Mon Sep 17 00:00:00 2001 From: Michael Gibson Date: Thu, 3 Dec 2020 13:02:16 -0600 Subject: [PATCH 2/2] Updated BRIDGE binary. --- initproton | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/initproton b/initproton index 258bc77..aa1f305 100755 --- a/initproton +++ b/initproton @@ -1,7 +1,7 @@ #!/bin/bash set -eufo pipefail -BRIDGE=/bin/protonmail-bridge +BRIDGE=/bin/proton-bridge FIFO=/tmp/fifo PRINT_INFO=${PRINT_INFO:-""} @@ -37,4 +37,4 @@ if [ -n "$LOG_LEVEL" ]; then ARGUMENTS="${ARGUMENTS} --log-level ${LOG_LEVEL}" fi -$BRIDGE $ARGUMENTS \ No newline at end of file +$BRIDGE $ARGUMENTS