-
Notifications
You must be signed in to change notification settings - Fork 108
build: Add devcontainer config #848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| FROM rust:1.95 | ||
|
|
||
| # Match a typical host Linux UID/GID (override in devcontainer.json "build" -> "args" if needed) | ||
| ARG USERNAME=vscode | ||
| ARG USER_UID=1000 | ||
| ARG USER_GID=1000 | ||
|
|
||
| ENV RUSTUP_HOME=/usr/local/rustup | ||
| ENV CARGO_HOME=/usr/local/cargo | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| sudo \ | ||
| python3 \ | ||
| python3-pip \ | ||
| python3-matplotlib \ | ||
| && groupadd --gid $USER_GID $USERNAME \ | ||
| && useradd -s /bin/bash -m -u $USER_UID -g $USER_GID $USERNAME \ | ||
| && chown -R $USER_UID:$USER_GID $RUSTUP_HOME $CARGO_HOME \ | ||
| && echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME \ | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW the default devcontainer configuration ( |
||
| && chmod 440 /etc/sudoers.d/$USERNAME \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| USER $USERNAME | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "name": "zip2", | ||
| "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", | ||
| "build": { | ||
| "dockerfile": "Dockerfile", | ||
| "context": "..", | ||
| "args": { | ||
| "USER_UID": "1000", | ||
| "USER_GID": "1000" | ||
|
Comment on lines
+8
to
+9
|
||
| } | ||
| }, | ||
| "postCreateCommand": "rustup component add rustfmt clippy", | ||
| "customizations": { | ||
| "codespaces": { | ||
| "openFiles": ["CONTRIBUTING.md", ".github/pull_request_template.md"] | ||
| }, | ||
| "vscode": { | ||
| "extensions": [ | ||
| "rust-lang.rust-analyzer" | ||
| ] | ||
| } | ||
|
Comment on lines
+17
to
+21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To better align the development environment with the project's strict CI requirements (clippy and multi-feature support), consider adding the "vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml"
],
"settings": {
"rust-analyzer.check.command": "clippy",
"rust-analyzer.cargo.allFeatures": true
}
} |
||
| }, | ||
| "remoteUser": "vscode", | ||
| "updateRemoteUserUID": false | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#848 (comment) 🙃