# Based on 20.04 LTS
FROM ubuntu:focal
RUN useradd -ms /bin/bash pltuser
ENV TZ=America/New_York
RUN ln -snf /usr/share/zoneinfo/$CONTAINER_TIMEZONE /etc/localtime && echo $CONTAINER_TIMEZONE > /etc/timezone
RUN apt-get -yq update && \
    apt-get -y upgrade && \
    DEBIAN_FRONTEND=noninteractive \
    apt-get -yq --no-install-suggests --no-install-recommends install \
    tzdata \
    ocaml \
    menhir \
    llvm-11 \
    llvm-11-dev \
    m4 \
    git \
    aspcud \
    ca-certificates \
    python2.7 \
    pkg-config \
    cmake \
    vim \
    opam
RUN ln -s /usr/bin/lli-11 /usr/bin/lli
RUN ln -s /usr/bin/llc-11 /usr/bin/llc

RUN mkdir /home/plt

#USER pltuser
RUN opam init --disable-sandboxing
RUN opam install -y \
    ctypes \
    llvm \
    utop \
    ocamlfind
WORKDIR /home/plt
COPY gassp gassp

#ENTRYPOINT ["opam", "config", "exec", "--"]

CMD ["bash"]
