-
Notifications
You must be signed in to change notification settings - Fork 2
Adopt devcontainer from https://github.com/jbcoe/pytorch-sandbox #16
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
Changes from 1 commit
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,2 @@ | ||
| rules: | ||
| sudo_usage: off |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Use Python:3.12-slim image as the base image as the PyTorch image | ||
| # https://hub.docker.com/r/pytorch/pytorch is too big (>3GB). | ||
| FROM python:3.12-slim | ||
|
|
||
| # Install essential packages and create non-root user | ||
| RUN apt-get update && apt-get install -y --no-install-recommends git curl sudo bash-completion vim \ | ||
|
jbcoe marked this conversation as resolved.
|
||
| && useradd -m -s /bin/bash vscode \ | ||
| && echo "vscode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \ | ||
| && mkdir -p /workspace \ | ||
| && chown vscode:vscode /workspace \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR /workspace | ||
|
|
||
| # Switch to non-root user | ||
| USER vscode | ||
|
|
||
| # Set up shell completions | ||
| RUN echo 'source /usr/share/bash-completion/completions/git' >> ~/.bashrc \ | ||
| && echo 'source /etc/bash_completion' >> ~/.bashrc | ||
|
|
||
| # Set up uv and Python environment | ||
| RUN curl -LsSf https://astral.sh/uv/install.sh | sh | ||
|
jbcoe marked this conversation as resolved.
|
||
|
|
||
| # Set up environment variables | ||
| ENV PATH="/home/vscode/.local/bin:${PATH}" | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||
| { | ||||||
| "name": "py_cppmodel Dev Container", | ||||||
|
||||||
| "name": "py_cppmodel Dev Container", | |
| "name": "py-cppmodel Dev Container", |
Copilot
AI
Jan 31, 2026
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.
The SSH mount attempts to support both Unix (HOME) and Windows (USERPROFILE) by concatenating environment variables. However, if both variables are set (which can happen on Windows with Git Bash or WSL), this will concatenate both paths creating an invalid path. A more robust approach would be to use conditional mounting or test this configuration on both platforms to ensure it works as intended.
| "source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached" | |
| "source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached" |
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.
I'll just use the UNIX-compliant path.
Uh oh!
There was an error while loading. Please reload this page.