Make the bridge run inside tmux to allow for easy user interaction within the container

This commit is contained in:
B. Olausson 2026-02-17 10:44:01 +01:00
parent 97014ae98c
commit c9bec759ba
2 changed files with 12 additions and 3 deletions

View File

@ -19,7 +19,7 @@ EXPOSE 143/tcp
# Install dependencies and protonmail bridge # Install dependencies and protonmail bridge
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y --no-install-recommends socat pass libsecret-1-0 ca-certificates \ && apt-get install -y --no-install-recommends socat pass libsecret-1-0 ca-certificates procps tmux \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Copy bash scripts # Copy bash scripts

View File

@ -16,7 +16,11 @@ if [[ $1 == init ]]; then
pkill protonmail-bridge || true pkill protonmail-bridge || true
# Login # Login
/protonmail/proton-bridge --cli $@ tmux new-session -d -s bridge-init "/protonmail/proton-bridge --cli $@"
echo "ProtonMail Bridge init running inside tmux session 'bridge-init'"
echo "Attach with: docker exec -it <container> tmux attach -t bridge-init"
sleep infinity
else else
@ -30,6 +34,11 @@ else
# Fake a terminal, so it does not quit because of EOF... # Fake a terminal, so it does not quit because of EOF...
rm -f faketty rm -f faketty
mkfifo faketty mkfifo faketty
cat faketty | /protonmail/proton-bridge --cli $@
tmux new-session -d -s bridge "cat faketty | /protonmail/proton-bridge --cli $@"
echo "ProtonMail Bridge running inside tmux session 'bridge'"
echo "Attach with: docker exec -it <container> tmux attach -t bridge"
sleep infinity
fi fi