-
-
Save semorrison/c810d3fb9ad189e2c3a65d129f7a15c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu | |
USER root | |
# Set timezone to UTC to avoid prompts from tzdata. | |
RUN TZ=UTC ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | |
# Install prerequisites. | |
RUN apt-get update && \ | |
apt-get install -y git curl && \ | |
apt-get clean | |
# create a non-root user | |
RUN useradd -m lean | |
USER lean | |
WORKDIR /home/lean | |
SHELL ["/bin/bash", "-c"] | |
# set the entrypoint to be a login shell, so everything is on the PATH | |
ENTRYPOINT ["/bin/bash", "-l"] | |
# install elan | |
RUN curl https://raw.githubusercontent.com/Kha/elan/master/elan-init.sh -sSf | sh -s -- -y && \ | |
. ~/.profile && \ | |
elan toolchain install $(curl https://raw.githubusercontent.com/leanprover-community/mathlib/master/leanpkg.toml | grep lean_version | awk -F'"' '{print $2}') && \ | |
elan toolchain uninstall stable | |
# make sure binaries are available even in non-login shells | |
ENV PATH="/home/lean/.elan/bin:/home/lean/.local/bin:$PATH" | |
RUN git clone https://github.com/leanprover/lake.git | |
WORKDIR /home/lean/lake | |
RUN lake +Kha/lean4:v4.0.0-bundle-rc build | |
RUN ./build/bin/lake |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment