CREDITS

WHAT DOES THIS DO?

This is a container that runs vscode.

WHY?

  • Impress your friends by running a GUI application in Docker.

HOW TO RUN IT?

  1. Make sure you're on a system running X.
  2. Disable X access control (don't do this on a public-facing machine): $ xhost +
  3. $ cd to a path where you want to write some code.
  4. $ docker run --rm -it -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD:$PWD -w $PWD -e DISPLAY=$DISPLAY hackenfreude/vscode
  5. You should see vscode pop up.
  6. Have fun. Write some code. Close vscode when you're done, and ctrl+c to shut down the container. Your files will be in the path on the host where you started.
  7. Reenable X access control: $ xhost -

WHAT JUST HAPPENED?

  • Docker mounted the host's X socket in the continer as the container's X socket; this allows the container's GUI to pass back up to the host.
  • Docker mounted the host's working directory in the container at the same path.

WHAT IF IT DOESN'T WORK?

Open an issue.