Skip to content

Commit 651c06c

Browse files
committed
feat: Update devcontainer.json + add Dockerfile (leanprover-community#2998)
This PR removes the external dependency for `devcontainer.json` by using a dockerfile to install elan. Another feature is that `lake exe cache get!` is now done using `onCreateCommand` instead of `postCreateCommand`, so the oleans should be available as soon as the container is created, whereas before the user had to wait a little while, which was potentially confusing.
1 parent f411c38 commit 651c06c

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.devcontainer/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM mcr.microsoft.com/devcontainers/base:jammy
2+
3+
USER vscode
4+
WORKDIR /home/vscode
5+
6+
RUN curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain none
7+
8+
ENV PATH="/home/vscode/.elan/bin:${PATH}"

.devcontainer/devcontainer.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
2-
"name": "Ubuntu",
3-
"image": "mcr.microsoft.com/devcontainers/base:jammy",
4-
"features": {
5-
"ghcr.io/adamtopaz/elan-feature/elan:0" : { "version" : "0.1.1" }
2+
"name": "Mathlib4 dev container",
3+
4+
"build": {
5+
"dockerfile": "Dockerfile"
66
},
7-
"postCreateCommand": "lake exe cache get!",
7+
8+
"onCreateCommand": "lake exe cache get!",
9+
810
"customizations": {
911
"vscode" : {
1012
"extensions" : [ "leanprover.lean4" ]

0 commit comments

Comments
 (0)