Skip to content

Commit 7990ab1

Browse files
committed
dev: update devcontainer to use pixi
1 parent f8329d3 commit 7990ab1

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

.devcontainer/Dockerfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
FROM mcr.microsoft.com/devcontainers/python:0-3.10
1+
FROM mcr.microsoft.com/devcontainers/base:jammy
22

3-
RUN apt-get update && apt install git-lfs
3+
ARG PIXI_VERSION=v0.32.1
44

5-
RUN python -m pip install --upgrade pip \
6-
&& python -m pip install 'flit>=3.8.0'
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
78

8-
ENV FLIT_ROOT_INSTALL=1
9+
# set some user and workdir settings to work nicely with vscode
10+
USER vscode
11+
WORKDIR /home/vscode
912

10-
COPY pyproject.toml .
11-
RUN touch README.md \
12-
&& mkdir -p src/python_template \
13-
&& python -m flit install --only-deps --deps develop \
14-
&& rm -r pyproject.toml README.md src
13+
RUN echo 'eval "$(pixi completion -s bash)"' >> /home/vscode/.bashrc

.devcontainer/devcontainer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
"dockerfile": "Dockerfile",
55
"context": ".."
66
},
7-
// "onCreateCommand": "pre-commit install --hook-type commit-msg",
8-
"postCreateCommand": "flit install --symlink;",
97
"customizations": {
108
"vscode": {
119
"extensions": [
@@ -24,4 +22,9 @@
2422
]
2523
}
2624
},
27-
}
25+
"features": {
26+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
27+
},
28+
"mounts": ["source=${localWorkspaceFolderBasename}-pixi,target=${containerWorkspaceFolder}/.pixi,type=volume"],
29+
"postCreateCommand": "sudo chown vscode .pixi && pixi install"
30+
}

0 commit comments

Comments
 (0)