Created
March 27, 2017 00:56
-
-
Save NickVanderPyle/7508275f0c3f8a6a6665b043b23303db to your computer and use it in GitHub Desktop.
Visual Studio Code running in a Docker Container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM microsoft/dotnet:latest | |
ENV DEBIAN_FRONTEND=noninteractive | |
VOLUME [".config/Code", \ | |
".vscode", \ | |
".ssh", \ | |
"src"] | |
RUN useradd --user-group --home $HOME code && \ | |
mkdir -p $HOME/.vscode/extensions $HOME/.config/Code/User && \ | |
touch $HOME/.config/Code/storage.json && \ | |
chown -R code:code $HOME | |
RUN apt-get update && \ | |
apt-get -y --no-install-recommends install apt-transport-https | |
RUN curl \ | |
--fail --silent --show-error \ | |
https://packages.microsoft.com/keys/microsoft.asc | \ | |
gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \ | |
echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list | |
RUN apt-get update && \ | |
apt-get -y --no-install-recommends install \ | |
aspell \ | |
aspell-en \ | |
autogen \ | |
automake \ | |
build-essential \ | |
code \ | |
curl \ | |
emacs \ | |
gettext \ | |
git \ | |
gvfs-bin \ | |
htop \ | |
libasound2 \ | |
libc6-dev \ | |
libcairo2 \ | |
libcanberra-gtk-module \ | |
libfontconfig1 \ | |
libgconf2-4 \ | |
libgl1-mesa-glx \ | |
libglib2.0-bin \ | |
libgtk2.0-0 libgtk-3-0 \ | |
libnotify-bin \ | |
libnss3 \ | |
libpango-1.0-0 \ | |
libstdc++6 \ | |
libtool \ | |
libxss1 \ | |
libxtst6 \ | |
mono-complete \ | |
nodejs \ | |
rxvt-unicode-256color \ | |
software-properties-common \ | |
sudo \ | |
unzip \ | |
wget \ | |
x11-xserver-utils \ | |
xterm && \ | |
apt-get autoclean && \ | |
apt-get clean && \ | |
apt-get autoremove | |
USER code | |
WORKDIR src | |
ENTRYPOINT ["/usr/bin/code","--wait","--verbose", "."] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
xhost +local:docker | |
docker run -d \ | |
-it \ | |
-v ${HOME}/.config/Code:/.config/Code \ | |
-v ${HOME}/.vscode:/.vscode \ | |
-v ${PWD}:/src \ | |
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \ | |
-e DISPLAY=unix${DISPLAY} \ | |
-p 5000:5000 \ | |
--device /dev/snd \ | |
vsdoc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mostly borrowed from: https://github.com/colebrumley/docker-vscode and https://github.com/cmiles74/docker-vscode