Skip to content

Instantly share code, notes, and snippets.

@kaave
Created June 30, 2023 01:08
Show Gist options
  • Save kaave/39085ea6423c8d63f4bcf8750926fa60 to your computer and use it in GitHub Desktop.
Save kaave/39085ea6423c8d63f4bcf8750926fa60 to your computer and use it in GitHub Desktop.
[Draft] My .devcontainer
// 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": {
// Programming languages
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "lts"
},
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/devcontainers/features/java:1": {},
"ghcr.io/devcontainers/features/python:1": {},
"ghcr.io/devcontainers/features/rust:1": {},
// Tools
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
// Note: 2023-06-25 現在、エラーになる。
// "ghcr.io/rchaganti/vsc-devcontainer-features/cuelang:1": {}
},
// 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": "./postCreateScript.bash"
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
#!/usr/bin/env bash
# -e: Exit immediately if a command exits with a non-zero status.
# -u: Treat unset variables as an error when substituting.
# -x: Print commands and their arguments as they are executed.
# -o pipefail: Causes a pipeline to return the exit status of the last command in the pipe that returned a non-zero return value.
set -euxo pipefail
# Some commands returns different results depending on the locale, so we set it to C.
export LC_ALL=C
# Cache current working dir.
# WORKDIR=$(pwd)
# Move to this script's dir.
# cd $(dirname "$0")
# ----------------
# Update apt
sudo apt update -y
sudo apt upgrade -y
# Install apt tools
sudo apt install -y direnv
# Install cuelang
go install cuelang.org/go/cmd/cue@latest
# Install buf
go install github.com/bufbuild/buf/cmd/buf@latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment