Skip to content

Commit

Permalink
feat (devcontainer): setup devcontainer for vscode
Browse files Browse the repository at this point in the history
- add devcontainer.json
- add postCreateCommand.sh
- update README.md
  • Loading branch information
johnnv1 committed Dec 30, 2024
1 parent 461b1da commit 8e74e54
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "Rust",
"image": "mcr.microsoft.com/devcontainers/rust:1-1",

// Set customizations for the container.
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"streetsidesoftware.code-spell-checker",
"charliermarsh.ruff",
"Gruntfuggly.todo-tree",
"nefrob.vscode-just-syntax"
]
}
},
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bash ./.devcontainer/postCreateCommand.sh",
// Define the user to use.
"remoteUser": "root"
}
8 changes: 8 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -ex

apt-get update && apt-get install -y cmake nasm libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev # Install NASM and GStreamer
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/bin # Install Just for command runner
curl -LsSf https://astral.sh/uv/install.sh | sh # Install UV for manage python virtual environments
rustc --version
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,22 @@ Clone the repository in your local directory
git clone https://github.com/kornia/kornia-rs.git
```
### 🐳 Devcontainer
This project includes a development container to provide a consistent development environment.
The devcontainer is configured to include all necessary dependencies and tools required for building and testing the `kornia-rs` project. It ensures that the development environment is consistent across different machines and setups.
**How to use**
1. **Install Remote - Containers extension**: In Visual Studio Code, install the `Remote - Containers` extension from the Extensions view (`Ctrl+Shift+X`).
2. **Open the project in the container**:
- Open the `kornia-rs` project folder in Visual Studio Code.
- Press `F1` and select `Remote-Containers: Reopen in Container`.
Visual Studio Code will build the container and open the project inside it. You can now develop, build, and test the project within the containerized environment.
### 🦀 Rust
Compile the project and run the tests
Expand Down

0 comments on commit 8e74e54

Please sign in to comment.