...
 
Commits (3)
FROM ubuntu:18.04
MAINTAINER Jun FURUSE <jun.furuse@dailambda.jp>
RUN apt-get clean
# Replacing the source
# # Replacing the source
# RUN sed -e 's|/archive\.ubuntu\.com/ubuntu|/ftp.jaist.ac.jp/pub/Linux/ubuntu|g' /etc/apt/sources.list > /tmp/sources.list
# RUN mv /tmp/sources.list /etc/apt/sources.list
RUN sed -e 's|/archive\.ubuntu\.com/ubuntu|/ftp.jaist.ac.jp/pub/Linux/ubuntu|g' /etc/apt/sources.list > /tmp/sources.list
RUN mv /tmp/sources.list /etc/apt/sources.list
RUN apt-get clean
RUN apt-get update
RUN apt-get install -y --no-install-recommends curl git ca-certificates make patch sudo netbase jq
# Git
# OCaml and OPAM
RUN apt install -y --no-install-recommends git ca-certificates
# OPAM (using old OCaml)
RUN apt install -y --no-install-recommends pkg-config libgmp-dev libev-dev libhidapi-dev m4 unzip bubblewrap ocaml g++
USER root
WORKDIR /
RUN git clone https://github.com/ocaml/opam
WORKDIR opam
RUN git checkout 2.0.3
RUN apt install -y --no-install-recommends \
curl pkg-config m4 unzip ocaml-nox git make patch
RUN apt install -y --no-install-recommends rsync
RUN apt install -y --no-install-recommends g++ # Required for the OPAM's internal solver
RUN ./configure
RUN make lib-ext && make && make install
RUN opam init -a --bare --disable-sandboxing # bwrap does not work...
RUN rm -rf /opam
RUN apt remove -y ocaml-nox # We do not need the old OCaml
RUN apt remove -y g++ # Required for the external solver
RUN apt autoremove -y
# SCaml
#
WORKDIR /
RUN git clone https://gitlab.com/dailambda/scaml.git
WORKDIR /scaml
RUN git checkout ${scaml-commit:-master}
RUN opam update
RUN opam switch create . ocaml-base-compiler.4.07.1
RUN opam update
# required for install local opams
RUN apt install -y --no-install-recommends rsync
RUN git pull
RUN git checkout @COMMIT@
RUN apt install -y --no-install-recommends libgmp-dev
RUN eval $(opam env) && env && opam install -y vendors/*/*.opam src/scaml.opam
RUN eval $(opam env) && which scamlc
RUN eval $(opam env) && scamlc src/tests/app_vote.ml && echo OK
# Cleanup
WORKDIR /
RUN du -sh /usr /scaml /root \
&& apt remove -y ocaml g++ \
&& apt autoremove -y \
&& apt-get clean \
&& rm -rf /opam \
&& (cd /scaml; opam clean) \
&& du -sh /usr /scaml /root
RUN du -sh /usr /scaml /root /var
WORKDIR /scaml
RUN eval $(opam env) && scamlc src/tests/app_vote.ml && echo OK
# Under /scaml, destorying the local OPAM switch
RUN opam clean
RUN opam clean -a
RUN rm -rf /scaml/_opam/.opam-switch
RUN du -sh /usr /scaml /root
#
# RUN du -sh /usr /home /tezos /root \
# && rm -rf /tezos/_build \
# && (tar zcf /tmp/tezos.tgz /tezos/_opam/lib/stublibs /tezos/_opam/lib/ocaml/stublibs /tezos/tezos-client /tezos/tezos-node /tezos/scripts /tezos/active_protocol_versions /tezos/.template) \
# && rm -rf /tezos \
# && (cd /; tar zxvf /tmp/tezos.tgz) \
# && rm -rf /.opam \
# && rm -rf /.git \
# && rm -rf /_opam/.opam-switch \
# && rm -rf /_opam/.npm \
# && rm -rf /_opam/.ocp \
# && du -sh /usr /home /tezos /root
# That's all
RUN tar zcf /tmp/scaml.tgz /scaml/_opam/lib/stublibs /scaml/_opam/lib/ocaml/stdlib.cmi /scaml/_opam/bin/scamlc /scaml/_opam/lib/scaml
RUN rm -rf /scaml/_opam
RUN tar xvf /tmp/scaml.tgz
# Destroy OPAM
RUN rm -rf /root/.opam
# Clean and destroy APT
RUN rm -rf /usr/local
RUN apt remove -y git gcc cpp-7 perl make
RUN apt remove -y '*-dev' > /dev/null 2>&1
RUN apt-get clean
RUN apt autoremove -y
RUN rm -rf /var/lib/apt
RUN du -sh /usr /scaml /root /var
RUN SCAMLIB=/scaml/_opam/lib/scaml /scaml/_opam/bin/scamlc /scaml/src/tests/app_vote.ml && echo OK
ENV SCAMLIB /scaml/_opam/lib/scaml
ENV PATH /scaml/_opam/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
CMD [ "scamlc", "--scaml-version" ]
#!/bin/bash
set -e
COMMIT=$1
if [ -z $COMMIT ]; then
echo Using master
COMMIT=master
fi
sed -e "s/@COMMIT@/$COMMIT/g" Dockerfile.in > Dockerfile
docker build --squash=true -t dailambda/scaml:$COMMIT .
......@@ -12,5 +12,5 @@
(* *)
(**************************************************************************)
let scaml = "1.0.1"
let scaml = "1.0.3"
let protocol = "005"