-
Notifications
You must be signed in to change notification settings - Fork 32
21 lines (19 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[Unit]
Description=Telegram with GUI in a container
Requires=docker.service graphical.target
After=docker.service
Wants=display-manager.service NetworkManager-wait-online.service network-online.target
[Service]
Environment=DNS=1.1.1.1
Environment="XAUTHORITY=/home/%i/.Xauthority"
Environment=DISPLAY=:0
Environment=TELEGRAM_DOCKER_IMAGE=xorilog/telegram
User=%i
Group=%i
ExecStartPre=-/usr/bin/docker pull ${TELEGRAM_DOCKER_IMAGE}
ExecStartPre=-/usr/bin/docker rm -vf telegram
ExecStart=/usr/bin/docker run -i --rm --name telegram --hostname="%H" --dns=${DNS} --ipc="host" --device /dev/snd -e XAUTHORITY -e http_proxy=${http_proxy} -e https_proxy=${https_proxy} -e no_proxy=${no_proxy} -e HTTP_PROXY=${http_proxy} -e HTTPS_PROXY=${https_proxy} -e NO_PROXY=${no_proxy} -e DISPLAY=unix${DISPLAY} -v /dev/shm:/dev/shm -v /etc/localtime:/etc/localtime:ro -v "/home/%i/.Xauthority:/home/user/.Xauthority" -v /tmp/.X11-unix:/tmp/.X11-unix -v /home/%i/.TelegramDesktop:/home/user/.local/share/TelegramDesktop ${TELEGRAM_DOCKER_IMAGE}
ExecStop=/usr/bin/docker rm -vf telegram
Restart=on-failure
[Install]
WantedBy=default.target