Skip to content

Instantly share code, notes, and snippets.

@semorrison
Created November 16, 2021 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save semorrison/c810d3fb9ad189e2c3a65d129f7a15c6 to your computer and use it in GitHub Desktop.
Save semorrison/c810d3fb9ad189e2c3a65d129f7a15c6 to your computer and use it in GitHub Desktop.
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