Skip to content

Instantly share code, notes, and snippets.

@mrvdb
Last active November 24, 2022 15:17
Show Gist options
  • Save mrvdb/62c7a6482053d95cd1289ff13a835a08 to your computer and use it in GitHub Desktop.
Save mrvdb/62c7a6482053d95cd1289ff13a835a08 to your computer and use it in GitHub Desktop.
Docker spec for telegram-desktop in container on ppc64le

Compiling telegram desktop, especially on power9 machines is quite a challenge.

I made a docker container spec based on the debian package of telegram desktop to make it easier on myself and I wouldn’t be limited to the web version of telegram, which is way too slow.

The container runs telegram desktop and uses the host X server and sound system. Not sure if the GPU is used by default.

Running:

  • clone this repository
  • create a file named .env and put USERNAME,UID and GID in there
  • docker-compose build
  • docker-compose up
As it is a container, clicking links won’t do much as we cant use the host browser
Make it more generic, esp. for other audio setups than mine
Determine UID,GID,USERNAME automatically?
Saves filling in the env file; at least use the determined ones as defaults
Is the non-privileged container setup I have relevant?
version: "3.4"
services:
app:
image: telegram-desktop:latest
group_add:
- audio
build:
context: .
args:
- UID=$UID
- GID=$GID
- USERNAME=$USERNAME
environment:
- DISPLAY=${DISPLAY}
volumes:
# Use the X server from host
- /tmp/.X11-unix:/tmp/.X11-unix
- $HOME/.Xauthority:/home/$USER/.Xauthority
# Video device mapping
- /dev/dri:/dev/dri
# Use pulseaudio from host
- /run/user/$UID/pulse/native:/run/user/$UID/pulse/native
# Make Telegram settings persistent
- $HOME/.local/share/TelegramDesktop:/home/$USER/.local/share/TelegramDesktop
# Make sure we can get to Downloads
- $HOME/Downloads:/home/$USER/Downloads
network_mode: host
FROM debian:unstable
MAINTAINER Marcel van der Boom <marcel@van-der-boom.nl>
RUN apt-get update && \
apt-get install -y telegram-desktop fonts-open-sans pulseaudio-utils
ARG UID
ARG GID
ARG USERNAME
RUN groupadd -g $UID $USERNAME && \
useradd -d /home/$USERNAME -s /bin/bash -m $USERNAME -u $UID -g $GID
USER $USERNAME
ENV HOME /home/$USERNAME
ENV XDG_RUNTIME_DIR /tmp/runtime-$USERNAME
ENV PULSE_SERVER unix:/run/user/$UID/pulse/native
ENV PULSE_SINK alsa_output.pci-0033_01_00.0.analog-surround-21
CMD /usr/bin/telegram-desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment