mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
chore(devcontainer): tweak devcontainer options (#13931)
Tweaked the devcontainer options so that the commands work in the dev container.
This commit is contained in:
3 files changed
+35
-19
No files matched your search
@@ -0,0 +1,7 @@
|
||||
FROM mcr.microsoft.com/devcontainers/rust:1
|
||||
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get -y install --no-install-recommends \
|
||||
just cmake
|
||||
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
||||
@@ -2,17 +2,16 @@
|
||||
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
|
||||
{
|
||||
"name": "Rust",
|
||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||
"image": "mcr.microsoft.com/devcontainers/rust:latest",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile"
|
||||
},
|
||||
"features": {
|
||||
// add `just` for running scripts
|
||||
"ghcr.io/guiyomh/features/just:0": {
|
||||
"ghcr.io/devcontainers/features/sshd:1": {},
|
||||
"ghcr.io/devcontainers/features/node:1": {},
|
||||
"ghcr.io/devcontainers/features/github-cli:1": {
|
||||
"version": "latest"
|
||||
},
|
||||
// add `cargo-binstall` for installing other tools.
|
||||
"ghcr.io/lee-orr/rusty-dev-containers/cargo-binstall:0": {
|
||||
"version": "latest"
|
||||
}
|
||||
"ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {}
|
||||
},
|
||||
// Configure tool-specific properties.
|
||||
"customizations": {
|
||||
@@ -27,15 +26,16 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"containerEnv": {
|
||||
"CLAUDE_CONFIG_DIR": "/home/vscode/.claude",
|
||||
"npm_config_store_dir": "/home/vscode/.local/share/pnpm"
|
||||
},
|
||||
|
||||
// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
|
||||
// "mounts": [
|
||||
// {
|
||||
// "source": "devcontainer-cargo-cache-${devcontainerId}",
|
||||
// "target": "/usr/local/cargo",
|
||||
// "type": "volume"
|
||||
// }
|
||||
// ]
|
||||
"mounts": [
|
||||
"source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind",
|
||||
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,readonly",
|
||||
"source=target,target=${containerWorkspaceFolder}/target,type=volume"
|
||||
],
|
||||
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
// "features": {},
|
||||
@@ -44,7 +44,5 @@
|
||||
// "forwardPorts": [],
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
"postCreateCommand": "just init"
|
||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||
// "remoteUser": "root"
|
||||
"postCreateCommand": "/bin/bash .devcontainer/postCreateCommand.sh"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
sudo chown -R "$(whoami)" "$(pwd)/target"
|
||||
|
||||
# cargo binstall (NOTE: update the commit when the script changes)
|
||||
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/3b64237893f03d6cce15ff4c5163026b681d5f9e/install-from-binstall-release.sh | bash
|
||||
|
||||
npm i -g @withgraphite/graphite-cli
|
||||
|
||||
just init
|
||||
Reference in new issue
Block a user