######################################################################
# Copyright 2021 Nicolas Feral and Alain Giorgetti                   #
# FEMTO-ST institute                                                 #
######################################################################

######################################################################
#  This software is distributed under the terms of the GNU Lesser    #
#  General Public License version 2.1                                #
######################################################################

# Dockerfile to build a Docker image with Why3 and Cubicle

# Predefined Docker image with Why3
FROM registry.gitlab.inria.fr/why3/why3:1.4.0

USER root

RUN apt-get update --allow-releaseinfo-change && \
  apt-get install -y autoconf automake wget m4 time libgmp-dev pkg-config \
  opam && apt-get clean

# Confirm the working directory
USER guest

WORKDIR /home/guest

# See https://github.com/ocaml/opam/issues/3498
RUN opam init  -n --disable-sandboxing

######################################################################
# Installation of Cubicle 1.1.2 with opam                            #
######################################################################

# Installation of Cubicle
RUN . ~/.profile && opam pin -y add cubicle 1.1.2

RUN opam env >> .bashrc

ENTRYPOINT ["/bin/bash"]

