Skip to content

Commit

Permalink
feat: Update devcontainer.json + add Dockerfile (#2998)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
adamtopaz committed Mar 20, 2023
1 parent f411c38 commit 651c06c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM mcr.microsoft.com/devcontainers/base:jammy

USER vscode
WORKDIR /home/vscode

RUN curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain none

ENV PATH="/home/vscode/.elan/bin:${PATH}"
12 changes: 7 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "Ubuntu",
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
"ghcr.io/adamtopaz/elan-feature/elan:0" : { "version" : "0.1.1" }
"name": "Mathlib4 dev container",

"build": {
"dockerfile": "Dockerfile"
},
"postCreateCommand": "lake exe cache get!",

"onCreateCommand": "lake exe cache get!",

"customizations": {
"vscode" : {
"extensions" : [ "leanprover.lean4" ]
Expand Down

0 comments on commit 651c06c

Please sign in to comment.