Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.
/ code-vs-docker Public archive

docker container for GUI app vscode

License

Times-Z/code-vs-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

code-vs-docker

Your favorite IDE as you've never seen it before (click on gif to view the video on youtube)

Alt text

Prerequisite


Parameters

You can parameters you're vscode settings

  • Put extension wee need in requirement.txt, if you have vs code local, you can use cd .config && rm requirement.txt && code --list-extensions > requirement.txt to freeze you're local extention
  • Put you're settings into settings.json

A test sample is already present in the config folder


Installation

# alias installation and .desktop application
./install.sh

# install extension that specified in config/requirement.txt
tty-dockcode install

# Run container without x11 binding (juste tty)
tty-dockcode bash

# Run container with x11 binding (open vscode window)
dockcode

Usage

On cli use dockcode (same as code on host) or tty-dockcode [command] (use bash ton enter in container)

You can use this two commands too :

Run container on window mode (like dockcode alias)

docker run --rm -d \
  --user $(id -u):$(id -g) \
  -v ${HOME}:/home/$(whoami):rw \
  -v ${HOME}/.ssh:/home/vscode/.ssh:rw \
  -v ${HOME}/.gitconfig:/home/vscode/.gitconfig:ro \
  -v /srv:/srv:rw \
  -v /tmp/.X11-unix:/tmp/.X11-unix:rw \
  -v /srv/vsdocker/.vscode:/home/$(whoami)/.vscode:rw \
  -v /srv/vsdocker/.config/Code:/home/$(whoami)/.config/Code:rw \
  -v /var/run/docker.sock:/var/run/docker.sock:rw \
  -v $(which docker):/usr/bin/docker:ro \
  -v $(which docker-compose):/usr/bin/docker-compose:ro \
  --network=host \
  -e DISPLAY=unix${DISPLAY} \
  -e HOME=/home/$(whoami) \
  -e USER=$(whoami) \
  -w /home/$(whoami) \
  --group-add $(stat -c '%g' /var/run/docker.sock) \
  --group-add sudo \
  crashzeus/vsdocker:stable launch > /dev/null

Run container on window mode (like tty-dockcode alias)

docker run -it --rm \
  --user $(id -u):$(id -g) \
  -v ${HOME}:/home/$(whoami):rw \
  -v ${HOME}/.ssh:/home/vscode/.ssh:rw \
  -v ${HOME}/.gitconfig:/home/vscode/.gitconfig:ro \
  -v /srv:/srv:rw \
  -v /srv/vsdocker/.vscode:/home/$(whoami)/.vscode:rw \
  -v /srv/vsdocker/.config/Code:/home/$(whoami)/.config/Code:rw \
  -v /var/run/docker.sock:/var/run/docker.sock:rw \
  -v $(which docker):/usr/bin/docker:ro \
  -v $(which docker-compose):/usr/bin/docker-compose:ro \
  --network=host \
  -e HOME=/home/$(whoami) \
  -e USER=$(whoami) \
  -w /home/$(whoami) \
  --group-add $(stat -c '%g' /var/run/docker.sock) \
  --group-add sudo \
  crashzeus/vsdocker:stable

About

docker container for GUI app vscode

Resources

License

Stars

Watchers

Forks

Packages