Skip to content

Commit

Permalink
Merge pull request #469 from moka-rs/devcontainer
Browse files Browse the repository at this point in the history
Add Dev Container
  • Loading branch information
tatsuya6502 authored Dec 8, 2024
2 parents 0c7bd33 + e3e2e8d commit 5f79d44
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// 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": "Moka",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/rust:1-1-bookworm",

// 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": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "./.devcontainer/ensure-rust-toolchains-installed.sh"

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
8 changes: 8 additions & 0 deletions .devcontainer/ensure-rust-toolchains-installed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

set -eu

rustup toolchain install stable -c clippy,rust-analysis,rust-src,rustfmt
rustup toolchain install beta -c clippy
rustup toolchain install 1.65.0
rustup default stable

0 comments on commit 5f79d44

Please sign in to comment.