Skip to content

Instantly share code, notes, and snippets.

@demaniak
Created April 24, 2020 06:55
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save demaniak/c56531c8d673a6f58ee54b5621796548 to your computer and use it in GitHub Desktop.
Save demaniak/c56531c8d673a6f58ee54b5621796548 to your computer and use it in GitHub Desktop.
Run Microsoft teams in docker on linux
#!/bin/bash
FILE=teams.deb
if [ ! -f "$FILE" ]; then
curl -L -o $FILE "https://go.microsoft.com/fwlink/p/?linkid=2112886&clcid=0x1c09&culture=en-za&country=za"
fi
docker build -t ms-teams-docker .
FROM ubuntu
RUN apt-get update && \
apt-get install -y curl apt-utils \
libasound2 libatk-bridge2.0-0 libcairo2 libcups2 libgdk-pixbuf2.0-0 \
libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 \
libsecret-1-0 libx11-xcb1 libxcomposite1 libxcomposite1 \
libxss1 apt-transport-https libxkbfile1
COPY teams.deb /tmp/teams.deb
RUN dpkg -i /tmp/teams.deb && apt-get install -f
#!/bin/bash
docker run -it --net=host --env="DISPLAY" \
--volume="$HOME/.Xauthority:/root/.Xauthority:rw" \
--privileged \
ms-teams-docker
@demaniak
Copy link
Author

There is no technical reason the deb file can not be downloaded in the the Dockerfile with curl.
During trail-and-error to get this working, download just took to long, so I externalized and re-used the file.

@demaniak
Copy link
Author

Currently, you will also need to manually launch "teams" from the container (after running the run.sh script, you will have an open command line in the container).

@thawkins
Copy link

Is there anyway to externalize the internal config and storage on teams so that you can run multiple copies of teams with different accounts using a separate mapped volume for each?

@demaniak
Copy link
Author

@thawkins - that should be completely possible, somebody would just need to:

  • investigate where teams is storing the relevant information (I have not dug that deep yet, but I suspect it might be under the user home folder)
  • figure out something around user permissions (maybe it's ok for the underlying system user user to have access to all the underlying profile and credentials, maybe not)

If we know where teams is storing the data, then the run command will just need additional --volume mounts, eg --volume /path/on/host/system:/path/to/internal/teams/storage/location

Apologies for the half-answer, this was a quick hack job under some time constraints (the meeting was starting!)

@thawkins
Copy link

I think its just '"~/.config/Microsoft/Microsoft Teams' but i will do some more checking and try it out.

@peterho86666
Copy link

peterho86666 commented Jul 4, 2020

Hi, i could get the app working from xming. But it doesnt work on vncclient. is it something to do with env display=: ?

@peterho86666
Copy link

how can i enable x11 forwarding on vnc so i could view the app on remote desk?

@Diadochokinetic
Copy link

Hello,

I just can't start teams. After running the run.sh a command line opens as intended. Unfortunately nothing happens when I try to launch teams. Any chance somebody has an idea what could cause the issue?

@k-popov
Copy link

k-popov commented Sep 21, 2020

Also makes sense to use a non-root user as the container itself is privileged:

RUN useradd teams && mkdir -p /home/teams && chown teams:teams /home/teams
USER teams

And with --volume="$HOME/.Xauthority:/home/teams/.Xauthority:rw" of course.

@olberger
Copy link

I've reused some its of this gist to embed everything in a fork of https://github.com/mdouchement/docker-zoom-us, which I have committed to https://github.com/olberger/docker-teams-linux

No warranty, as I haven't tested much.

Hope this works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment