Skip to content

Instantly share code, notes, and snippets.

@finesse-fingers
Last active April 28, 2025 14:31
Show Gist options
  • Save finesse-fingers/7b197695c8c654ca04fee58d0f7a6df4 to your computer and use it in GitHub Desktop.
Save finesse-fingers/7b197695c8c654ca04fee58d0f7a6df4 to your computer and use it in GitHub Desktop.
VSC Dev Container Utilities
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
"ghcr.io/devcontainers/features/azure-cli:1": {
"version": "latest",
"bicepVersion": "latest"
},
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"installOhMyZshConfig": true,
"upgradePackages": true,
"username": "automatic",
"userUid": "automatic",
"userGid": "automatic"
},
"ghcr.io/devcontainers/features/github-cli:1": {
"installDirectlyFromGitHubRelease": true,
"version": "latest"
}
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": ".devcontainer/init-container.sh",
// Configure tool-specific properties.
"customizations": {
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"aaron-bond.better-comments",
"vscode-icons-team.vscode-icons",
"streetsidesoftware.code-spell-checker",
"GitHub.copilot",
"GitHub.copilot-chat",
"VisualStudioExptTeam.vscodeintellicode",
"VisualStudioExptTeam.intellicode-api-usage-examples",
"DavidAnson.vscode-markdownlint",
"esbenp.prettier-vscode",
"redhat.vscode-yaml"
]
}
},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# install brew
echo insecure >> ~/.curlrc
export HOMEBREW_CURLRC=1
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "" >> ~/.zshrc && echo '# Ensure homebrew is enabled' >> ~/.zshrc
echo 'export HOMEBREW_CURLRC=1' >> ~/.zshrc
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.zshrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
# install packages using brew
brew install kubectl helm gh libpq derailed/k9s/k9s
# ensure libpq is in path
echo "" >> ~/.zshrc && echo '# Ensure libpq is in path' >> ~/.zshrc
echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/libpq/bin:$PATH"' >> ~/.zshrc
# finally modify ~/.zshrc plugins to include (git kubectl helm zsh-autosuggestions)
sed -i 's/plugins=(git)/plugins=(git kubectl helm zsh-autosuggestions)/' ~/.zshrc
# install brew
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo >> /home/vscode/.zshrc
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/vscode/.zshrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "Added Homebrew to .zshrc and sourced it..."
sudo apt-get install build-essential
# install zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
echo "Installed zsh-autosuggestions plugin..."
# enable it by updating .zshrc by changing plugins=(git) to plugins=(git zsh-autosuggestions)
sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions)/' ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment