├── .github └── workflows │ └── build.yml ├── Dockerfile ├── LICENSE ├── README.md └── start.sh /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: 'Build Discord Container' 2 | 3 | on: 4 | push: 5 | schedule: 6 | - cron: 0 8 * * * 7 | 8 | jobs: 9 | build: 10 | 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@master 15 | 16 | - name: install curl and jq 17 | run: | 18 | sudo apt-get update && sudo apt-get install -y curl jq 19 | 20 | - name: login 21 | env: 22 | DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} 23 | DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} 24 | run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL 25 | 26 | - name: Get Discord stable release versions 27 | run: | 28 | curl -sSI "https://discordapp.com/api/download?platform=linux&format=deb" | grep -i "location: " | awk "{print $2}" | tr -d "[:space:]" | sed -e "s/.*discord-//g" | sed -e "s/.deb//g" > ${GITHUB_WORKSPACE}/discord-stable-version 29 | 30 | - name: Get Discord Canary release version 31 | run: | 32 | curl -sSI "https://discordapp.com/api/download/ptb?platform=linux&format=deb" | grep -i "location: " | awk "{print $2}" | tr -d "[:space:]" | sed -e "s/.*discord-//g" | sed -e "s/.deb//g" > ${GITHUB_WORKSPACE}/discord-canary-version 33 | 34 | - name: Build the latest stable Discord release 35 | run: | 36 | docker build --build-arg DOWNLOAD_LINK="https://discordapp.com/api/download?platform=linux&format=deb" -t keyglitch/discord:stable . && \ 37 | docker tag keyglitch/discord:stable keyglitch/discord:stable-$(cat ${GITHUB_WORKSPACE}/discord-stable-version) && \ 38 | docker push keyglitch/discord:stable && \ 39 | docker push keyglitch/discord:stable-$(cat ${GITHUB_WORKSPACE}/discord-stable-version) 40 | 41 | - name: Build the latest canary Discord release 42 | run: | 43 | docker build --build-arg DOWNLOAD_LINK="https://discordapp.com/api/download/ptb?platform=linux&format=deb" -t keyglitch/discord:canary . && \ 44 | docker tag keyglitch/discord:canary keyglitch/discord:canary-$(cat ${GITHUB_WORKSPACE}/discord-canary-version) && \ 45 | docker push keyglitch/discord:canary && \ 46 | docker push keyglitch/discord:canary-$(cat ${GITHUB_WORKSPACE}/discord-canary-version) 47 | 48 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # DESCRIPTION: Containerized Discord 2 | # AUTHOR: davidk 3 | # COMMENTS: This Dockerfile wraps Discord into a Docker container. 4 | # Based on Jess Frazelle's work at: https://github.com/jessfraz/ 5 | # 6 | # USAGE: 7 | # 8 | # # Build image 9 | # docker build -t discord --build-arg DOWNLOAD_LINK=PATH_TO_CANARY_OR_NORMAL_BUILD . 10 | # 11 | # # Run it! 12 | # docker run -v /tmp/.X11-unix:/tmp/.X11-unix \ 13 | # --device /dev/snd \ 14 | # -v discordSettings:/home/discord \ 15 | # -v /dev/shm:/dev/shm:z \ 16 | # -v /etc/localtime:/etc/localtime:ro \ 17 | # -v /var/run/dbus:/var/run/dbus \ 18 | # -v /var/run/user/$(id -u)/bus:/var/run/user/1000/bus \ 19 | # -e DBUS_SESSION_BUS_ADDRESS="unix:path=/var/run/user/1000/bus" \ 20 | # -v /var/run/user/$(id -u)/pulse:/var/run/user/1000/pulse \ 21 | # -e PULSE_SERVER="unix:/run/user/1000/pulse/native" \ 22 | # -e DISPLAY=unix$DISPLAY --rm --group-add $(getent group audio | cut -d: -f3) discord 23 | # 24 | # # If this fails, it might either be SELinux or 25 | # # just needing to allow access to your local X session 26 | # xhost local:root 27 | # 28 | # VOLUME MANAGEMENT: 29 | # 30 | # # Remove and wipe settings 31 | # docker volume rm discordSettings 32 | # 33 | # # Information about where stuff is 34 | # docker volume inspect discordSettings 35 | 36 | FROM debian:bullseye-slim 37 | 38 | RUN apt-get update && apt-get install -y \ 39 | libgl1 \ 40 | libcurl4 \ 41 | libgbm1 \ 42 | libdrm2 \ 43 | libc++1 \ 44 | libappindicator1 \ 45 | gconf2 \ 46 | gconf-service \ 47 | gvfs-bin \ 48 | libasound2 \ 49 | libcap2 \ 50 | libgconf-2-4 \ 51 | libgtk-3-0 \ 52 | libcanberra-gtk3-module \ 53 | libpulse0 \ 54 | libnotify4 \ 55 | libnss3 \ 56 | libxkbfile1 \ 57 | libxss1 \ 58 | libxtst6 \ 59 | libx11-xcb1 \ 60 | xdg-utils \ 61 | libatomic1 \ 62 | fonts-noto-color-emoji \ 63 | --no-install-recommends \ 64 | && rm -rf /var/lib/apt/lists/* \ 65 | && apt-get autoremove -y \ 66 | && apt-get autoclean 67 | 68 | RUN groupadd discord \ 69 | && useradd -g discord --create-home --home-dir /home/discord discord 70 | 71 | WORKDIR /home/discord 72 | 73 | # DOWNLOAD_LINK 74 | # Canary URL: https://discordapp.com/api/download/ptb?platform=linux&format=deb 75 | # Stable URL: https://discordapp.com/api/download?platform=linux&format=deb 76 | # 77 | # Deb URL: curl -sSI 'https://discordapp.com/api/download/ptb?platform=linux&format=deb' | grep -F 'location: ' | awk '{print $2}' | tr -d '[:space:]' 78 | # Version: curl -sSI 'https://discordapp.com/api/download?platform=linux&format=deb' | grep -i 'location: ' | awk '{print $2}' | tr -d '[:space:]' | sed -e 's/.*discord-//g' | sed -e 's/.deb//g' 79 | # 80 | 81 | ARG DOWNLOAD_LINK 82 | 83 | RUN apt-get update && apt-get install -y \ 84 | curl \ 85 | ca-certificates \ 86 | --no-install-recommends \ 87 | && curl -sSL "${DOWNLOAD_LINK}" > discord.deb \ 88 | && dpkg -i discord.deb \ 89 | && rm -rf /var/lib/apt/lists/* \ 90 | && apt-get purge -y --auto-remove curl \ 91 | && apt-get autoclean \ 92 | && chown -R discord:discord /home/discord \ 93 | && rm -f /etc/localtime 94 | 95 | COPY start.sh /opt/scripts/ 96 | RUN chmod +x /opt/scripts/start.sh 97 | 98 | VOLUME /home/discord/ 99 | ENTRYPOINT [ "/opt/scripts/start.sh" ] 100 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 davidk 4 | Derived from work done by Jessie Frazelle @ github.com/jessfraz/dockerfiles 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-discord 2 | 3 | This will run the latest release version of Discord in a Docker container: 4 | 5 | Canary: 6 | 7 | keyglitch/discord:canary 8 | 9 | Stable: 10 | 11 | keyglitch/discord:stable 12 | 13 | 14 | Depending on the version, Discord will likely download updates and quit, stopping the container -- just re-run to start since the volume it downloads to is persisted. 15 | 16 | Note: SELinux on Fedora isn't too happy with this container (mostly to do with desktop notifications through libnotify), so be sure to add exceptions as needed. Sound is also quite finicky, and is not muxed with the host (so playing audio on the host will block the container, vice versa). 17 | 18 | docker run --privileged \ 19 | -v /tmp/.X11-unix:/tmp/.X11-unix \ 20 | --device /dev/snd \ 21 | -v discordSettings:/home/discord \ 22 | -v /dev/shm:/dev/shm:z \ 23 | -v /etc/localtime:/etc/localtime:ro \ 24 | -v /var/run/dbus:/var/run/dbus \ 25 | -v /var/run/user/$(id -u)/bus:/var/run/user/1000/bus \ 26 | -e DBUS_SESSION_BUS_ADDRESS="unix:path=/var/run/user/1000/bus" \ 27 | -v /var/run/user/$(id -u)/pulse:/var/run/user/1000/pulse \ 28 | -e PULSE_SERVER="unix:/run/user/1000/pulse/native" \ 29 | -e DISPLAY=unix$DISPLAY \ 30 | --rm \ 31 | --group-add $(getent group audio | cut -d: -f3) \ 32 | keyglitch/discord:stable 33 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Allow access to the bus for notifications (libnotify) 3 | chown 1000:1000 -R /var/run/user/1000 4 | [[ -e "/usr/bin/discord" ]] && su discord -c /usr/bin/discord || su discord -c /usr/bin/discord-ptb 5 | --------------------------------------------------------------------------------