From 724c6e3009455e9a5900aba58bb38e18405d2c83 Mon Sep 17 00:00:00 2001 From: gbarkley Date: Fri, 9 Jun 2023 16:55:01 -0700 Subject: [PATCH] added gitpod files --- .docker/gitpod/Dockerfile | 37 +++++++++++++++++++++++++++++++++++++ gitpod.yml | 9 +++++++++ 2 files changed, 46 insertions(+) create mode 100644 .docker/gitpod/Dockerfile create mode 100644 gitpod.yml diff --git a/.docker/gitpod/Dockerfile b/.docker/gitpod/Dockerfile new file mode 100644 index 0000000..7fef689 --- /dev/null +++ b/.docker/gitpod/Dockerfile @@ -0,0 +1,37 @@ +# This is the Dockerfile for `leanprovercommunity/mathlib:gitpod`. + +# gitpod doesn't support multiple FROM statements, (or rather, you can't copy from one to another) +# so we just install everything in one go +FROM ubuntu:jammy + +USER root + +RUN apt-get update && apt-get install sudo git curl git bash-completion python3 -y && apt-get clean + +RUN useradd -l -u 33333 -G sudo -md /home/gitpod -s /bin/bash -p gitpod gitpod \ + # passwordless sudo for users in the 'sudo' group + && sed -i.bkp -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers +USER gitpod +WORKDIR /home/gitpod + +SHELL ["/bin/bash", "-c"] + +# gitpod bash prompt +RUN { echo && echo "PS1='\[\033[01;32m\]\u\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]\$(__git_ps1 \" (%s)\") $ '" ; } >> .bashrc + +# install elan +RUN curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain none + +# install whichever toolchain mathlib is currently using +RUN . ~/.profile && elan toolchain install $(curl https://raw.githubusercontent.com/leanprover-community/mathlib4/master/lean-toolchain) + +ENV PATH="/home/gitpod/.local/bin:/home/gitpod/.elan/bin:${PATH}" + +# fix the infoview when the container is used on gitpod: +ENV VSCODE_API_VERSION="1.50.0" + +# ssh to github once to bypass the unknown fingerprint warning +RUN ssh -o StrictHostKeyChecking=no github.com || true + +# run sudo once to suppress usage info +RUN sudo echo finished \ No newline at end of file diff --git a/gitpod.yml b/gitpod.yml new file mode 100644 index 0000000..6acf55c --- /dev/null +++ b/gitpod.yml @@ -0,0 +1,9 @@ +image: + file: .docker/gitpod/Dockerfile + +vscode: + extensions: + - leanprover.lean4 + +tasks: + - init: lake exe cache get