-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_debian
96 lines (81 loc) · 2.46 KB
/
Dockerfile_debian
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
ARG BRIDGE_VERSION='3.19.0'
ARG GOLANG_VERSION='1.24.2'
ARG GOLANG_ARCH='amd64'
FROM digrouz/debian-s6:latest as builder
ARG BRIDGE_VERSION
ARG GOLANG_VERSION
ARG GOLANG_ARCH
### Environment variables
ENV BRIDGE_VERSION="${BRIDGE_VERSION}" \
GOLANG_VERSION="${GOLANG_VERSION}" \
GOLANG_ARCH="${GOLANG_ARCH}"
RUN set -x && \
apt-get update && \
apt-get -y --no-install-recommends dist-upgrade && \
apt-get install -y --no-install-recommends\
build-essential \
ca-certificates \
curl \
git \
libsecret-1-dev \
&& \
cd /tmp && \
curl -SsL https://go.dev/dl/go${GOLANG_VERSION}.linux-${GOLANG_ARCH}.tar.gz -o /tmp/golang.tar.gz && \
tar xzf /tmp/golang.tar.gz -C /opt && \
git clone --depth 1 --branch v${BRIDGE_VERSION} https://github.com/ProtonMail/proton-bridge.git /tmp/proton-bridge && \
cd /tmp/proton-bridge && \
PATH=/opt/go/bin:$PATH && \
make build-nogui && \
ls -l1
FROM digrouz/debian-s6:latest as su-exec-builder
ARG BRIDGE_VERSION
### Environment variables
ENV BRIDGE_VERSION="${BRIDGE_VERSION}"
RUN set -x && \
apt-get update && \
apt-get -y --no-install-recommends dist-upgrade && \
apt-get install -y --no-install-recommends\
build-essential \
ca-certificates \
curl \
git \
&& \
cd /tmp && \
git clone --depth 1 https://github.com/ncopa/su-exec /tmp/su-exec && \
cd /tmp/su-exec && \
make
FROM digrouz/debian-s6:latest
LABEL maintainer "DI GREGORIO Nicolas <nicolas.digregorio@gmail.com>"
ARG BRIDGE_VERSION
### Environment variables
ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
BRIDGE_VERSION="${BRIDGE_VERSION}" \
XDG_CONFIG_HOME="/home/appuser"
### Copy files
COPY root/ /
COPY --from=builder /tmp/proton-bridge/bridge /opt/protonmail/bin/proton-bridge
COPY --from=su-exec-builder /tmp/su-exec/su-exec /usr/local/bin/
### Install Application
RUN set -x && \
apt-get update && \
apt-get -y --no-install-recommends dist-upgrade && \
apt-get install -y --no-install-recommends \
ca-certificates \
gpg-agent \
libsecret-1.0 \
pass \
socat \
&& \
chmod 755 /opt/protonmail/bin/proton-bridge && \
chown -R appuser:appuser /opt/protonmail && \
apt-get -y autoclean && \
apt-get -y clean && \
apt-get -y autoremove && \
rm -rf /tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
### Volume
#Volume ["/volume1"]
### Expose ports
Expose 25/tcp
Expose 143/tcp