Skip to content

Commit d900f50

Browse files
committed
chore: tweak devcontainer options
1 parent ad14a41 commit d900f50

File tree

3 files changed

+34
-19
lines changed

3 files changed

+34
-19
lines changed

.devcontainer/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM mcr.microsoft.com/devcontainers/rust:1
2+
3+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
4+
&& apt-get -y install --no-install-recommends \
5+
just cmake
6+
7+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

.devcontainer/devcontainer.json

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
33
{
44
"name": "Rust",
5-
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/rust:latest",
5+
"build": {
6+
"dockerfile": "Dockerfile"
7+
},
78
"features": {
8-
// add `just` for running scripts
9-
"ghcr.io/guiyomh/features/just:0": {
9+
"ghcr.io/devcontainers/features/sshd:1": {},
10+
"ghcr.io/devcontainers/features/node:1": {},
11+
"ghcr.io/devcontainers/features/github-cli:1": {
1012
"version": "latest"
1113
},
12-
// add `cargo-binstall` for installing other tools.
13-
"ghcr.io/lee-orr/rusty-dev-containers/cargo-binstall:0": {
14-
"version": "latest"
15-
}
14+
"ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {}
1615
},
1716
// Configure tool-specific properties.
1817
"customizations": {
@@ -27,15 +26,16 @@
2726
]
2827
}
2928
},
29+
"containerEnv": {
30+
"CLAUDE_CONFIG_DIR": "/home/vscode/.claude",
31+
"npm_config_store_dir": "/home/vscode/.local/share/pnpm"
32+
},
3033

31-
// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
32-
// "mounts": [
33-
// {
34-
// "source": "devcontainer-cargo-cache-${devcontainerId}",
35-
// "target": "/usr/local/cargo",
36-
// "type": "volume"
37-
// }
38-
// ]
34+
"mounts": [
35+
"source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind",
36+
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,readonly",
37+
"source=target,target=${containerWorkspaceFolder}/target,type=volume"
38+
],
3939

4040
// Features to add to the dev container. More info: https://containers.dev/features.
4141
// "features": {},
@@ -44,7 +44,5 @@
4444
// "forwardPorts": [],
4545

4646
// Use 'postCreateCommand' to run commands after the container is created.
47-
"postCreateCommand": "just init"
48-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
49-
// "remoteUser": "root"
47+
"postCreateCommand": "/bin/bash .devcontainer/postCreateCommand.sh"
5048
}

.devcontainer/postCreateCommand.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
set -eu
2+
3+
sudo chown -R "$(whoami)" "$(pwd)/target"
4+
5+
# cargo binstall
6+
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
7+
8+
npm i -g @withgraphite/graphite-cli
9+
10+
just init

0 commit comments

Comments
 (0)