forked from mirrors/protonmail-bridge-docker
improve build readability and speed (by parallelization) (#117)
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
*
|
||||
|
||||
!.dockerignore
|
||||
!VERSION
|
||||
!entrypoint.sh
|
||||
!install.sh
|
||||
!gpgparams
|
||||
!Dockerfile
|
||||
@@ -1,5 +1,16 @@
|
||||
### The Deb install is just a repack of the official ProtonMail Bridge deb package with less dependencies.
|
||||
### I recommend you don't use this. It's here for legacy reasons.
|
||||
|
||||
FROM debian:sid-slim AS build
|
||||
|
||||
COPY install.sh PACKAGE /
|
||||
RUN apt-get update && apt-get install -y wget binutils
|
||||
|
||||
# Repack deb (removes unnecessary dependencies and produces /protonmail.deb)
|
||||
RUN bash /install.sh
|
||||
|
||||
FROM debian:sid-slim
|
||||
LABEL maintainer="Xiaonan Shen <s@sxn.dev>"
|
||||
LABEL maintainer="Simon Felding <sife@adm.ku.dk>"
|
||||
|
||||
EXPOSE 25/tcp
|
||||
EXPOSE 143/tcp
|
||||
@@ -7,16 +18,11 @@ EXPOSE 143/tcp
|
||||
WORKDIR /protonmail
|
||||
|
||||
# Copy bash scripts
|
||||
COPY gpgparams install.sh entrypoint.sh VERSION /protonmail/
|
||||
COPY gpgparams entrypoint.sh PACKAGE /protonmail/
|
||||
COPY --from=build /protonmail.deb /tmp/protonmail.deb
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends socat pass procps libsecret-1-0 ca-certificates \
|
||||
&& apt-get install -y --no-install-recommends /tmp/protonmail.deb socat pass libsecret-1-0 ca-certificates procps \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy bash scripts
|
||||
COPY gpgparams entrypoint.sh /protonmail/
|
||||
|
||||
# Install dependencies and protonmail bridge
|
||||
RUN bash install.sh
|
||||
|
||||
ENTRYPOINT ["bash", "/protonmail/entrypoint.sh"]
|
||||
CMD ["bash", "/protonmail/entrypoint.sh"]
|
||||
|
||||
1
deb/PACKAGE
Normal file
1
deb/PACKAGE
Normal file
@@ -0,0 +1 @@
|
||||
https://github.com/ProtonMail/proton-bridge/releases/download/v3.19.0/protonmail-bridge_3.19.0-1_amd64.deb
|
||||
@@ -1 +0,0 @@
|
||||
3.19.0-1
|
||||
@@ -1,36 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
VERSION=`cat VERSION`
|
||||
DEB_FILE=protonmail-bridge_${VERSION}_amd64.deb
|
||||
|
||||
# Install dependents
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends socat pass ca-certificates
|
||||
|
||||
# Build time dependencies
|
||||
apt-get install -y wget binutils xz-utils
|
||||
|
||||
# Repack deb (remove unnecessary dependencies)
|
||||
mkdir deb
|
||||
wget -i /PACKAGE -O /deb/protonmail.deb
|
||||
cd deb
|
||||
wget -q https://protonmail.com/download/bridge/${DEB_FILE}
|
||||
ar x -v ${DEB_FILE}
|
||||
ar x -v protonmail.deb
|
||||
mkdir control
|
||||
tar zxvf control.tar.gz -C control
|
||||
sed -i "s/^Depends: .*$/Depends: libgl1, libc6, libsecret-1-0, libstdc++6, libgcc1/" control/control
|
||||
cd control
|
||||
tar zcvf ../control.tar.gz .
|
||||
cd ../
|
||||
ar rcs -v ${DEB_FILE} debian-binary control.tar.gz data.tar.gz
|
||||
cd ../
|
||||
|
||||
# Install protonmail bridge
|
||||
apt-get install -y --no-install-recommends ./deb/${DEB_FILE}
|
||||
|
||||
# Cleanup
|
||||
apt-get purge -y wget binutils xz-utils
|
||||
apt-get autoremove -y
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
rm -rf deb
|
||||
ar rcs -v /protonmail.deb debian-binary control.tar.gz data.tar.gz
|
||||
|
||||
Reference in New Issue
Block a user