Commit 2fdd3bda authored by Kim Nguyễn's avatar Kim Nguyễn
Browse files

Make the Dockerfile more generic.

parent 40dca5cc
...@@ -4,9 +4,6 @@ LABEL maintainer="Kim Nguyen <kim.nguyen@universite-paris-saclay.fr>" ...@@ -4,9 +4,6 @@ LABEL maintainer="Kim Nguyen <kim.nguyen@universite-paris-saclay.fr>"
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
ARG ocaml_version="4.12.0"
ARG packages=""
RUN apt-get update -y && \ RUN apt-get update -y && \
apt-get dist-upgrade -y && \ apt-get dist-upgrade -y && \
apt-get install -y -q \ apt-get install -y -q \
...@@ -23,9 +20,8 @@ RUN apt-get update -y && \ ...@@ -23,9 +20,8 @@ RUN apt-get update -y && \
libsigsegv2 libstdc++-9-dev libsub-override-perl libtool libtsan0 libubsan1\ libsigsegv2 libstdc++-9-dev libsub-override-perl libtool libtsan0 libubsan1\
libuchardet0 libx11-dev libxau-dev libxcb1-dev libxdmcp-dev \ libuchardet0 libx11-dev libxau-dev libxcb1-dev libxdmcp-dev \
linux-libc-dev m4 make man-db pkg-config po-debconf x11proto-core-dev \ linux-libc-dev m4 make man-db pkg-config po-debconf x11proto-core-dev \
x11proto-dev libcurl4-gnutls-dev libexpat1-dev pkg-config wget unzip \ x11proto-dev libcurl4-gnutls-dev libexpat1-dev pkg-config wget unzip
bubblewrap
RUN mkdir -p /usr/local/bin && wget -O /usr/local/bin/opam \ RUN mkdir -p /usr/local/bin && wget -O /usr/local/bin/opam \
'https://github.com/ocaml/opam/releases/download/2.0.8/opam-2.0.8-x86_64-linux' && \ 'https://github.com/ocaml/opam/releases/download/2.0.8/opam-2.0.8-x86_64-linux' && \
chmod 755 /usr/local/bin/opam chmod 755 /usr/local/bin/opam
...@@ -40,18 +36,21 @@ RUN adduser --disabled-password --gecos "" --shell /bin/bash cduce ...@@ -40,18 +36,21 @@ RUN adduser --disabled-password --gecos "" --shell /bin/bash cduce
USER cduce USER cduce
ARG OPAMYES=true ARG OPAMYES=true
ARG ocaml_version
ARG packages
RUN test "$ocaml_version" || test "$packages" || exit 1
RUN opam init --disable-sandboxing && \ RUN opam init --disable-sandboxing --bare && \
opam switch create ${ocaml_version} && \ opam switch create "$ocaml_version" && \
eval `opam config env` && \ eval `opam config env` && \
test "${packages}" && opam install -y ${packages} opam install -y ${packages}
ENV TZ "Europe/Paris" ENV TZ "Europe/Paris"
ENV LANG en_US.UTF-8 ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8 ENV LC_ALL en_US.UTF-8
ENV HOME /home/cduce
ENTRYPOINT [ "opam", "exec", "--" ] ENTRYPOINT [ "opam", "exec", "--" ]
CMD [ "/bin/sh", "-c", "bash" ] CMD [ "/bin/sh", "-c", "bash" ]
\ No newline at end of file
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