Commit 8f818201 authored by François Bobot's avatar François Bobot

[Docker] Add the choice of the debian image

    - update and upgrade before any apt-get installation (the cache make
    that lines could be executed month apart)
    - use depext in opam to check that all the needed debian packages
    are installed
parent 5d7c83c6
FROM ocaml/ocaml:debian-stable
ARG debian_version=stable
FROM ocaml/ocaml:debian-$debian_version
# install dependencies
RUN apt-get update -yq && apt-get upgrade -yq --with-new-pkgs --auto-remove
RUN apt-get update -yq && apt-get upgrade -yq --with-new-pkgs --auto-remove && apt-get install -yq --no-install-recommends wget libgmp-dev gtk+-2.0 libgtksourceview2.0-dev gnome-themes-standard libcanberra-gtk-module opam xvfb unzip build-essential autoconf automake
ARG debian_packages
RUN apt-get update
RUN apt-get install -y wget libgmp-dev gtk+-2.0 libgtksourceview2.0-dev gnome-themes-standard libcanberra-gtk-module opam xvfb
RUN apt-get install -y $debian_packages
RUN apt-get update -yq && apt-get upgrade -yq --with-new-pkgs --auto-remove && apt-get install -yq --no-install-recommends $debian_packages
RUN apt-get clean
# create user
......@@ -16,7 +17,11 @@ WORKDIR /home/why3
ARG compiler=system
RUN opam init -a -y -j1 --compiler=$compiler
RUN opam repository add coq-released https://coq.inria.fr/opam/released
RUN opam install -y depext
ARG opam_packages
RUN opam depext --dry-run menhir conf-gtksourceview lablgtk ocamlgraph zarith camlzip alt-ergo
RUN opam install -y menhir conf-gtksourceview lablgtk ocamlgraph zarith camlzip alt-ergo
RUN test -z "$opam_packages" || opam depext --dry-run $opam_packages
RUN test -z "$opam_packages" || opam install -y $opam_packages
......@@ -2,13 +2,22 @@
set -e
if test -z "$DEBIAN_VERSION"; then
DEBIAN_VERSION="stable"
fi
autoconf && (automake --add-missing 2> /dev/null || true)
if test -n "$DEBIAN_PACKAGES" -o -n "$OPAM_PACKAGES"; then
IMAGE=bench-image-$COMPILER--$(echo $DEBIAN_PACKAGES | sed -e 's/ /--/g')--$(echo $OPAM_PACKAGES | sed -e 's/ /--/g')
else
IMAGE=bench-image-$COMPILER
IMAGE=bench-image-$COMPILER-$DEBIAN_VERSION
if test -n "$DEBIAN_PACKAGES"; then
IMAGE=$IMAGE--$(echo $DEBIAN_PACKAGES | sed -e 's/ /--/g')
fi
docker build -t $IMAGE --force-rm -f misc/Dockerfile.init --build-arg compiler=$COMPILER --build-arg debian_packages="$DEBIAN_PACKAGES" --build-arg opam_packages="$OPAM_PACKAGES" .
if test -n "$OPAM_PACKAGES"; then
IMAGE=$IMAGE--$(echo $OPAM_PACKAGES | sed -e 's/ /--/g')
fi
docker build -t $IMAGE --force-rm -f misc/Dockerfile.init --build-arg debian_version="$DEBIAN_VERSION" --build-arg compiler=$COMPILER --build-arg debian_packages="$DEBIAN_PACKAGES" --build-arg opam_packages="$OPAM_PACKAGES" .
CID=$(docker create --rm -i -w /home/why3/why3 $IMAGE /bin/sh)
docker start $CID
docker cp . $CID:/home/why3/why3
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment