Last active
November 10, 2023 17:50
-
-
Save knkillname/f8c3e40451678539fb49787703b4360d to your computer and use it in GitHub Desktop.
Setup Visual Studio Code + Dev Containers Extension in Linux
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 | |
set -e | |
# Err if user is root | |
if [ "$EUID" -eq 0 ]; then | |
echo "Please do not run as root" | |
exit | |
fi | |
# Install git, docker, and VSCode dependencies | |
sudo apt-get update --yes | |
sudo apt-get install --yes apt-transport-https docker.io git gpg wget | |
# Install VSCode | |
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg | |
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg | |
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' | |
rm -f packages.microsoft.gpg | |
sudo apt-get update --yes | |
sudo apt-get --yes install code | |
# Install the Remote Dev Container extension for VSCode | |
code --install-extension ms-vscode-remote.remote-containers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run in a single command from a Linux Terminal:
wget -O https://gist.githubusercontent.com/knkillname/f8c3e40451678539fb49787703b4360d/raw/94d3465190a098ef6effb41d3e73cad3c69e9137/setup-devcontainers.sh | bash