Skip to content

Commit 1b0b9e2

Browse files
Add GitHub Codespaces config for Pixi (#10929)
1 parent 9e6ebf2 commit 1b0b9e2

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM mcr.microsoft.com/devcontainers/base:jammy
2+
3+
ARG PIXI_VERSION=v0.59.0
4+
5+
RUN curl -L -o /usr/local/bin/pixi -fsSL --compressed "https://github.com/prefix-dev/pixi/releases/download/${PIXI_VERSION}/pixi-$(uname -m)-unknown-linux-musl" \
6+
&& chmod +x /usr/local/bin/pixi \
7+
&& pixi info
8+
9+
# set some user and workdir settings to work nicely with vscode
10+
USER vscode
11+
WORKDIR /home/vscode
12+
13+
RUN echo 'eval "$(pixi completion -s bash)"' >> /home/vscode/.bashrc

.devcontainer/devcontainer.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "my-workspace",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": ".."
6+
},
7+
"hostRequirements": {
8+
"cpus": 4,
9+
"memory": "16gb"
10+
},
11+
"customizations": {
12+
"vscode": {
13+
"settings": {},
14+
"extensions": ["ms-python.python", "charliermarsh.ruff", "GitHub.copilot"]
15+
}
16+
},
17+
"features": {
18+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
19+
},
20+
"mounts": [
21+
"source=${localWorkspaceFolderBasename}-pixi,target=${containerWorkspaceFolder}/.pixi,type=volume"
22+
],
23+
"postCreateCommand": "sudo chown vscode .pixi && pixi install"
24+
}

0 commit comments

Comments
 (0)