Skip to content

Commit

Permalink
chore: update devcontainer mounts
Browse files Browse the repository at this point in the history
better caching with volumes for cargo
  • Loading branch information
storopoli committed Jun 29, 2024
1 parent bb34600 commit 23c7c19
Showing 1 changed file with 26 additions and 30 deletions.
56 changes: 26 additions & 30 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// 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",
"features": {
"ghcr.io/devcontainers/features/node:latest": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
// "mounts": [
// {
// "source": "devcontainer-cargo-cache-${devcontainerId}",
// "target": "/usr/local/cargo",
// "type": "volume"
// }
// ]
// 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": [
3000
]
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "rustc --version",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
"name": "Rust",

"image": "mcr.microsoft.com/devcontainers/rust:latest",

"features": {
"ghcr.io/devcontainers/features/node:latest": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},

"mounts": [
{
"source": "${localEnv:HOME}${localEnv:USERPROFILE}/.config/gh",
"target": "/home/vscode/.config/gh",
"type": "bind"
},
{
"source": "devcontainer-cargo-cache",
"target": "/usr/local/cargo",
"type": "volume"
}
],

"forwardPorts": [
3000
]
}

0 comments on commit 23c7c19

Please sign in to comment.