-
Notifications
You must be signed in to change notification settings - Fork 32
/
Dockerfile
82 lines (71 loc) · 2.14 KB
/
Dockerfile
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
# Gathering of binary
FROM debian:bookworm-slim as downloader
ARG telegram_version=""
ARG http_proxy=""
ARG https_proxy=""
ARG apt_sources="http://deb.debian.org"
RUN sed -i "s@http://deb.debian.org@$apt_sources@g" /etc/apt/sources.list.d/debian.sources && \
apt-get update && apt-get install -y \
apt-utils \
software-properties-common \
wget \
xz-utils \
curl \
--no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Telegram Version 5.8.1
RUN env \
http_proxy=$http_proxy \
https_proxy=$https_proxy \
wget https://updates.tdesktop.com/tlinux/tsetup."${telegram_version:-$(curl \
-sXGET \
--head https://telegram.org/dl/desktop/linux \
| grep location \
| cut -d '/' -f 5 \
|cut -d '.' -f 2-4 \
)}".tar.xz \
-O /tmp/telegram.tar.xz \
&& cd /tmp/ \
&& tar xvfJ /tmp/telegram.tar.xz \
&& mv /tmp/Telegram/Telegram /usr/bin/Telegram \
&& rm -rf /tmp/{telegram.tar.xz,Telegram}
# Base docker image
FROM debian:bookworm
LABEL maintainer "Christophe Boucharlat <christophe.boucharlat@gmail.com>"
LABEL org.opencontainers.image.source https://github.com/xorilog/docker-telegram
# Make a user
ENV HOME /home/user
RUN useradd --create-home --home-dir $HOME user \
&& chown -R user:user $HOME \
&& usermod -a -G audio,video user
ARG http_proxy=""
ARG https_proxy=""
ARG apt_sources="http://deb.debian.org"
# Install required deps
RUN sed -i "s@http://deb.debian.org@$apt_sources@g" /etc/apt/sources.list.d/debian.sources && \
apt-get update && apt-get install -y \
apt-utils \
dbus-x11 \
dunst \
hunspell-en-us \
python3-dbus \
software-properties-common \
libx11-xcb1 \
libpulse0 \
gconf2 \
libdrm2 \
libgtk-3-0 \
libice6 \
libsm6 \
libegl1-mesa-dev \
libgl1-mesa-glx \
--no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=downloader --chown=user /usr/bin/Telegram /home/user/Telegram
WORKDIR $HOME
USER user
ENV QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb
# Autorun Telegram
CMD ["/home/user/Telegram"]