-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmailpile-v1.sh
executable file
·36 lines (31 loc) · 1.01 KB
/
mailpile-v1.sh
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
#!/bin/bash
if [ "$1" == "update" ]; then
exec docker pull mailpile/mailpile-v1
elif [ "$1" == "daemon" ]; then
DOCKER_HOW="-d"
elif [ "$1" == "run" ]; then
DOCKER_HOW="-it"
else
cat <<tac
Usage:
$0 pull # Pull the latest Mailpile image from Docker hub
$0 run # Run in the foreground (displays console logs)
$0 daemon # Run in the background
Run Mailpile in a docker container, as the current user ($(id -un)).
The Mailpile instance will have access to your home directory and will read
and write files in ~/.local/share/Mailpile/ as usual. The environment
variables MAILPILE_PORT and MAILPILE_PROFILE can be set to deviate from the
default values.
tac
exit 1
fi
MDU="$(id -un) $(id -u) $(id -g)"
MPP=${MAILPILE_PORT:-33411}
set -x
exec docker run $DOCKER_HOW --rm \
-p $MPP:$MPP \
-v /home/:/home/ \
-e MAILPILE_PROFILE="${MAILPILE_PROFILE:-default}" \
-e MAILPILE_DOCKER_USER="$MDU" \
mailpile/mailpile-v1 \
docker-user-wrap mailpile --www="0.0.0.0:$MPP/" --wait