Fixed binary name, added RELEASE option.

This commit is contained in:
Michael Gibson 2020-12-03 13:01:56 -06:00
parent 89cff04248
commit f3e41a2856

View file

@ -2,6 +2,7 @@
FROM golang:1.14-alpine as build FROM golang:1.14-alpine as build
ENV LANG C.UTF-8 ENV LANG C.UTF-8
RUN apk add --no-cache \ RUN apk add --no-cache \
curl \
gcc \ gcc \
git \ git \
libsecret-dev \ libsecret-dev \
@ -9,11 +10,19 @@ RUN apk add --no-cache \
musl-dev musl-dev
WORKDIR /usr/src WORKDIR /usr/src
ARG RELEASE
ARG TAG ARG TAG
RUN git clone https://github.com/ProtonMail/proton-bridge.git proton-bridge \ RUN if [ -n "$RELEASE" ]; then \
&& cd proton-bridge \ echo "Using release $RELEASE..." \
&& if [ -n "$TAG" ]; then echo "Using tags/$TAG..."; git checkout tags/$TAG; fi \ && curl -L -s "https://github.com/ProtonMail/proton-bridge/archive/$RELEASE.tar.gz" | tar zx \
&& make build-nogui && 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. # Create a container for the ProtonMail Bridge.
FROM alpine:edge FROM alpine:edge
@ -22,7 +31,7 @@ ENV LANG C.UTF-8
EXPOSE 25/tcp EXPOSE 25/tcp
EXPOSE 143/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 entrypoint /bin/
COPY initproton /bin/ COPY initproton /bin/
RUN apk add --no-cache \ RUN apk add --no-cache \