This repository provides a Docker image running cdr/code-server.
Docker image: titom73/vscode
This image was originally built for Arista Validated Design with this repository.
# Run titom73/vscode container
$ docker run --rm -d -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 titom73/vscode:latest
# Connect to your browser
$ open http://127.0.0.1:8080
As it is for development and local use only, there is no password protection ! Never expose container to untrust or Internet.
VSC_PASSWORD: Allow user to set a password to use for VScode authentication. If not set, access is not protected by any password.VSC_GIT_USER: Username to configure in .gitconfig file.
VSC_GIT_USER=$(git config --get user.name)VSC_GIT_EMAIL: Email to configure in .gitconfig file.
VSC_GIT_EMAIL=$(git config --get user.email)VSC_USER_EXTENSIONS_FILE: Allow user to installed additional VScode extensionsVSC_USER_REPOS: Path to a text file in your container with a list of repository to clone (1 repository per line)VSC_USER_SCRIPT: Path to a shell script to execute during entrypoint execution.These settings must be used to mount and edit file from your physical host.
VSC_UID: set uid for avd user in container.VSC_GID: set gid for avd user in container.Current container has docker installed and can be used in a Docker-in-Docker approach. To run docker, you must share your docker socket with container:
Docker Socket on Linux / Macos
-v /var/run/docker.sock:/var/run/docker.sock
Docker Socket on Windows
-v //var/run/docker.sock:/var/run/docker.sock
docker run --rm -it -d \
-e VSC_GIT_USER=titom73 \
-e [email protected] \
-v /var/run/docker.sock:/var/run/docker.sock \
-p 8080:8080 \
titom73/vscode:latest
docker run --rm -it -d \
-e VSC_GIT_USER=titom73 \
-e [email protected] \
-v ${PWD}/your-local-work:/home/vsc/arista-ansible \
-v /var/run/docker.sock:/var/run/docker.sock \
-p 8080:8080 \
titom73/vscode:latest
docker run --rm -it -d \
-e VSC_USER_EXTENSIONS_FILE=my_settings/user-extensions.txt \
-e VSC_GIT_USER=titom73 \
-e [email protected] \
-v ${PATH_TO_FOLDER_WITH_EXT_FILE}/tests:/home/vsc/my_settings \
-v ${PWD}/your-local-work:/home/vsc/arista-ansible \
-v /var/run/docker.sock:/var/run/docker.sock \
-p 8080:8080 \
titom73/vscode:latest
Easy to manage TOI and ATD with docker-compose command
# Start single node stack
$ docker-compose up -d
Creating network "avd-vscode_default" with the default driver
Creating avd-vscode_avd-coder_1 ... done
# get dynamic port mapping
$ docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------
avd-vscode_avd-coder_1 /bin/entrypoint.sh Up 0.0.0.0:55000->8080/tcp
# Scale up environment
$ docker-compose --scale avd-coder=3
Creating avd-vscode_avd-coder_2 ... done
Creating avd-vscode_avd-coder_3 ... done
$ docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------
avd-vscode_avd-coder_1 /bin/entrypoint.sh Up 0.0.0.0:55000->8080/tcp
avd-vscode_avd-coder_2 /bin/entrypoint.sh Up 0.0.0.0:55002->8080/tcp
avd-vscode_avd-coder_3 /bin/entrypoint.sh Up 0.0.0.0:55001->8080/tcp
$ kubectl apply -f k8s-deployment.yml
deployment.apps/avd-coder-deployment created
service/avd-coder-service created
$ kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
avd-coder-service NodePort 10.152.183.196 <none> 8080:31081/TCP 5s
Project is published under Apache 2.0 License
Content type
Image
Digest
sha256:38e38c069…
Size
572.7 MB
Last updated
over 2 years ago
docker pull titom73/vscode