They recently installed a Rocket.Chat server at my office, which is a chat software solution. Since I didn't want to install it directly on my computer and had never tried Docker, I decided to put it in a container.
root@host:~# apt install apt-transport-https ca-certificates curl software-properties-common gnupg2
root@host:~# curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
root@host:~# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
root@host:~# apt update
root@host:~# apt install docker-ce
root@host:~# systemctl status docker
root@host:~# usermod -aG docker user
user@debian:~$ docker search debian
user@debian:~$ docker image pull debian
FROM debian:11
RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y wget gconf2 gconf-service libnotify4 libappindicator1 libxtst6 libnss3 libxss1 libasound2 sudo libsecret-1-0 xdg-utils libgbm1
RUN wget https://github.com/RocketChat/Rocket.Chat.Electron/releases/download/3.9.3/rocketchat-3.9.3-linux-amd64.deb
RUN dpkg -i rocketchat-3.9.3-linux-amd64.deb
RUN export uid=1000 gid=1000 && \
mkdir -p /home/user && \
echo "user:x:${uid}:${gid}:Developer,,,:/home/user:/bin/bash" >> /etc/passwd && \
echo "user:x:${uid}:" >> /etc/group && \
echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user && \
chmod 0440 /etc/sudoers.d/user && \
chown ${uid}:${gid} -R /home/user
USER user
ENV HOME /home/user
CMD rocketchat-desktop
user@debian:~$ cd /home/user/Docker
user@debian:~$ docker build -t rocket .
user@debian:~$ docker run --privileged -ti --rm -e DISPLAY -v $HOME/.Xauthority:/home/user/.Xauthority --net=host rocket
Let's see what to do if we want to launch firefox and rocket.chat applications in the same container.
#! /bin/bash
firefox-esr&
rocketchat-desktop
user@debian:~$ chmod +x /home/user/applications.sh
FROM debian:11
RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y wget gconf2 gconf-service libnotify4 libappindicator1 libxtst6 libnss3 libxss1 libasound2 sudo firefox-esr libsecret-1-0 xdg-utils libgbm1
RUN wget https://github.com/RocketChat/Rocket.Chat.Electron/releases/download/3.9.3/rocketchat-3.9.3-linux-amd64.deb
RUN dpkg -i rocketchat-3.9.3-linux-amd64.deb
RUN export uid=1000 gid=1000 && \
mkdir -p /home/user && \
echo "user:x:${uid}:${gid}:Developer,,,:/home/user:/bin/bash" >> /etc/passwd && \
echo "user:x:${uid}:" >> /etc/group && \
echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user && \
chmod 0440 /etc/sudoers.d/user && \
chown ${uid}:${gid} -R /home/user
USER user
ENV HOME /home/user
COPY ./applications.sh /home/user/
CMD /home/user/applications.sh
user@debian:~$ docker build -t fire-rocket .
user@debian:~$ docker run --privileged -ti --rm -e DISPLAY -v $HOME/.Xauthority:/home/user/.Xauthority --net=host fire-rocket
Contact :