2022-11-06 05:15:08 +00:00
|
|
|
# Use carlosedp/golang for riscv64 support
|
|
|
|
|
FROM carlosedp/golang:1.18 AS build
|
2020-06-01 13:51:24 +00:00
|
|
|
|
|
|
|
|
# Install dependencies
|
2022-11-06 05:15:08 +00:00
|
|
|
RUN apt-get update && apt-get install -y git build-essential libsecret-1-dev
|
2020-06-01 13:51:24 +00:00
|
|
|
|
|
|
|
|
# Build
|
|
|
|
|
WORKDIR /build/
|
|
|
|
|
COPY build.sh VERSION /build/
|
|
|
|
|
RUN bash build.sh
|
|
|
|
|
|
2022-04-06 12:14:31 +00:00
|
|
|
FROM ubuntu:focal
|
2020-06-01 13:51:24 +00:00
|
|
|
LABEL maintainer="Xiaonan Shen <s@sxn.dev>"
|
|
|
|
|
|
|
|
|
|
EXPOSE 25/tcp
|
|
|
|
|
EXPOSE 143/tcp
|
|
|
|
|
|
|
|
|
|
# Install dependencies and protonmail bridge
|
|
|
|
|
RUN apt-get update \
|
2021-01-07 13:14:11 +00:00
|
|
|
&& apt-get install -y --no-install-recommends socat pass libsecret-1-0 ca-certificates \
|
2020-06-01 13:51:24 +00:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
# Copy bash scripts
|
|
|
|
|
COPY gpgparams entrypoint.sh /protonmail/
|
|
|
|
|
|
|
|
|
|
# Copy protonmail
|
2022-11-05 06:30:33 +00:00
|
|
|
COPY --from=build /build/proton-bridge/bridge /protonmail/
|
2021-01-07 10:19:11 +00:00
|
|
|
COPY --from=build /build/proton-bridge/proton-bridge /protonmail/
|
2020-06-01 13:51:24 +00:00
|
|
|
|
2021-07-25 16:42:10 +00:00
|
|
|
# Add a user 'protonmail' with UID 8535
|
|
|
|
|
RUN useradd -u 8535 -d /home/protonmail protonmail \
|
|
|
|
|
&& mkdir -p /home/protonmail \
|
|
|
|
|
&& chown protonmail: /home/protonmail
|
|
|
|
|
# change to non-privileged user for extra security
|
|
|
|
|
USER protonmail
|
|
|
|
|
|
2020-06-01 13:51:24 +00:00
|
|
|
ENTRYPOINT ["bash", "/protonmail/entrypoint.sh"]
|