Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@
FROM debian:jessie
LABEL maintainer "Christophe Boucharlat <christophe.boucharlat@gmail.com>"

# Discord Version 0.0.2
# Discord Version 0.0.4

RUN apt-get update && apt-get install -y \
apt-utils \
dbus-x11 \
dunst \
hunspell-en-us \
python3-dbus \
software-properties-common \
libx11-xcb1 \
gconf2 \
libgtk2.0-0 \
libxtst6 \
libnss3 \
libasound2 \
libatomic1 \
libgconf-2-4 \
libnotify4 \
libnspr4 \
libnss3 \
libxss1 \
libxtst6 \
libappindicator1 \
libc++1 \
wget \
--no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN wget https://dl.discordapp.net/apps/linux/0.0.1/discord-0.0.1.tar.gz -O /tmp/discord.tar.gz && \
RUN wget http://dl.discordapp.net/apps/linux/0.0.4/discord-0.0.4.tar.gz -O /tmp/discord.tar.gz && \
cd /tmp/ && \
tar xvzf /tmp/discord.tar.gz && \
rm /etc/fonts/conf.d/10-scale-bitmap-fonts.conf && \
fc-cache -fv
fc-cache -fv && \
rm /tmp/discord.tar.gz

ENV QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb

Expand Down
38 changes: 24 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,43 @@ A Docker image that start a fresh discord client.
[![Image Layers](https://images.microbadger.com/badges/image/xorilog/discord.svg)](https://microbadger.com/images/xorilog/discord)


## Usage
## Usage
To spawn a new instance of Discord:

```shell
docker run --rm -it --name discord \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=unix$DISPLAY \
--device /dev/snd \
-v /etc/localtime:/etc/localtime:ro \
-v <Your_storage_dir>/.config/discord/:/root/.config/discord/ \
xorilog/discord
USER=$(whoami);
xhost + local:discord; #allow discord to connect to X
docker run --rm -it \
--name discord \
--hostname discord \
-v /home/$USER:/home/$USER \
-e DISPLAY=$DISPLAY \
-v /etc/group:/etc/group:ro \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/shadow:/etc/shadow:ro \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
-v /etc/localtime:/etc/localtime:ro \
--user $(id -u) \
--device /dev/snd \
discord;
xhost - local:discord; #remove discord from being allowed to connect to X
```
## Issues
* You have to log out Discord to close the docker container.
The previous commands is to be run on a linux machine. But Mac users, I have a special surprise for you. You can also do fun hacks with X11. Details are described [here](https://github.com/docker/docker/issues/8710).

## Issues
* You have to log out Discord or be sure 'minimize to try' is turned off in user settings under linux settings to be able to close discord fully.


## FAQ
### Docker <1.8
Before Docker 1.8 you need to replace `--device /dev/snd` by `-v /dev/snd:/dev/snd --privileged`.


### QXcbConnection: Could not connect to display unix:0
### 'QXcbConnection: Could not connect to display unix:0' or 'No protocol specified'
Some form of
```shell
xhost +
```
do not forget to remove it after start or usage (`xhost -`)
The previous command is to be run on a linux machine. But Mac users, I have a special surprise for you. You can also do fun hacks with X11. Details are described [here](https://github.com/docker/docker/issues/8710).
Before running is required to get this working and remember to remove after finished usage (`xhost -`)


Thanks to [Discord](https://discordapp.com/) for their great app !
4 changes: 3 additions & 1 deletion update.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash

# Gather latest version of discord
version=$(curl --head "https://discordapp.com/api/download?platform=linux&format=tar.gz" |grep Location |cut -d '/' -f 6)
version=$(curl --head "https://discordapp.com/api/download?platform=linux&format=tar.gz" |grep -i location |cut -d '/' -f 6)

sed -i 's/Discord\ Version\ [0-9]*\.[0-9]*\.[0-9]*$/\Discord\ Version\ '$version'/' Dockerfile
sed -i 's/linux\/[0-9]*\.[0-9]*\.[0-9]*\/discord-[0-9]*\.[0-9]*\.[0-9]*/linux\/'$version'\/discord-'$version'/' Dockerfile

git commit -am "Discord version $version" -S
git tag -am "Discord version $version" $version
git push --follow-tags