aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.devcontainer
diff options
context:
space:
mode:
author简律纯 <hsiangnianian@outlook.com>2023-04-28 01:36:44 +0800
committer简律纯 <hsiangnianian@outlook.com>2023-04-28 01:36:44 +0800
commitdd84b9d64fb98746a230cd24233ff50a562c39c9 (patch)
treeb583261ef00b3afe72ec4d6dacb31e57779a6faf /.devcontainer
parent0b46fcd72ac34382387b2bcf9095233efbcc52f4 (diff)
downloadHydroRoll-dd84b9d64fb98746a230cd24233ff50a562c39c9.tar.gz
HydroRoll-dd84b9d64fb98746a230cd24233ff50a562c39c9.zip
Diffstat (limited to '.devcontainer')
-rw-r--r--.devcontainer/Dockerfile33
-rw-r--r--.devcontainer/devcontainer.json56
2 files changed, 89 insertions, 0 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
new file mode 100644
index 0000000..3c0db66
--- /dev/null
+++ b/.devcontainer/Dockerfile
@@ -0,0 +1,33 @@
+# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.233.0/containers/go/.devcontainer/base.Dockerfile
+
+# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1, 1.16, 1.17, 1-bullseye, 1.16-bullseye, 1.17-bullseye, 1-buster, 1.16-buster, 1.17-buster
+ARG VARIANT="1.18-bullseye"
+FROM mcr.microsoft.com/vscode/devcontainers/go:0-${VARIANT}
+
+RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
+ && apt-get -y install --no-install-recommends \
+ # Chromium for running Turbopack benchmarks
+ chromium \
+ # Used for plotters graph visualizations in turbopack benchmarks
+ libfontconfig1-dev
+
+# Add hyperfine, a useful benchmarking tool
+RUN dpkgArch="$(dpkg --print-architecture)"; \
+ wget "https://github.com/sharkdp/hyperfine/releases/download/v1.12.0/hyperfine_1.12.0_${dpkgArch}.deb" && dpkg -i "hyperfine_1.12.0_${dpkgArch}.deb"
+
+#
+# Everything below is run as the vscode user. If superuser permissions are necessary,
+# run it before this. Otherwise, prefer running as the vscode user.
+#
+USER vscode
+
+# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
+ARG NODE_VERSION="none"
+RUN if [ "${NODE_VERSION}" != "none" ]; then umask 0002 && sh -c ". /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION}" 2>&1; fi
+
+RUN sh -c ". /usr/local/share/nvm/nvm.sh && npm install -g vercel yarn yalc pnpm nodemon" 2>&1
+
+# The installer from https://rustup.rs/ homepage, with the following changes:
+# * `-y` to accept without interactivity
+# * `--default-toolchain none` to avoid installing stable rust. Our specific toolchain is installed post-create.
+RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 0000000..d9c7d4c
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,56 @@
+// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
+// https://github.com/microsoft/vscode-dev-containers/tree/v0.233.0/containers/go
+{
+ "name": "turbo (go, node, rust)",
+ "build": {
+ "dockerfile": "Dockerfile",
+ "args": {
+ // Update the VARIANT arg to pick a version of Go: 1, 1.18, 1.17
+ // Append -bullseye or -buster to pin to an OS version.
+ // Use -bullseye variants on local arm64/Apple Silicon.
+ "VARIANT": "1.18-bullseye",
+ // Options
+ "NODE_VERSION": "lts/*"
+ }
+ },
+ "runArgs": ["--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],
+
+ // Set *default* container specific settings.json values on container create.
+ "settings": {
+ "go.toolsManagement.checkForUpdates": "local",
+ "go.useLanguageServer": true,
+ "go.gopath": "/go"
+ },
+
+ // Add the IDs of extensions you want installed when the container is created.
+ "extensions": [
+ "bradlc.vscode-tailwindcss",
+ "christian-kohler.npm-intellisense",
+ "dbaeumer.vscode-eslint",
+ "eamodio.gitlens",
+ "EditorConfig.EditorConfig",
+ "esbenp.prettier-vscode",
+ "github.copilot",
+ "github.vscode-pull-request-github",
+ "golang.go",
+ "heybourn.headwind",
+ "rust-lang.rust-analyzer",
+ "silvenon.mdx",
+ "windmilleng.vscode-go-autotest",
+ "yzhang.markdown-all-in-one"
+ ],
+
+ // 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": "go version && cargo --version", // Invoking `cargo` will eagerly install the toolchain specified in rust-toolchain file
+
+ // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
+ "remoteUser": "vscode",
+ "features": {
+ "docker-in-docker": "latest",
+ "git": "latest",
+ "github-cli": "latest"
+ }
+}