Commit d8a82191 authored by Jun Furuse's avatar Jun Furuse

Small docker image

parent 2aa0ef99
FROM ubuntu:18.04
MAINTAINER Jun FURUSE <[email protected]>
RUN apt-get clean
# Replacing the source
# # Replacing the source
# RUN sed -e 's|/archive\.ubuntu\.com/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|/|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
RUN git clone
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...
# required for install local opams
RUN apt install -y --no-install-recommends rsync
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
RUN git clone
WORKDIR /scaml
......@@ -35,29 +39,37 @@ RUN opam switch create . ocaml-base-compiler.4.07.1
RUN opam update
RUN git pull
RUN git checkout @[email protected]
RUN apt install -y --no-install-recommends libgmp-dev
RUN eval $(opam env) && env && opam install -y vendors/*/*.opam src/scaml.opam
# Cleanup
RUN du -sh /usr /scaml /root /var
RUN rm -rf /opam
RUN (cd /scaml; opam clean)
RUN opam clean
# Under /scaml, destorying the local OPAM switch
RUN opam clean -a
RUN rm -rf /scaml/_opam/.opam-switch
RUN rm -rf /root/.opam
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
RUN rm -rf /usr/local
RUN apt remove -y ocaml g++ git gcc bubblewrap ca-certificates cpp-7
RUN apt-get clean
# 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 remove -y curl perl make
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/ && 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" ]
......@@ -4,8 +4,8 @@ set -e
if [ -z $COMMIT ]; then
echo "Must specify the commit"
exit 2
echo Using master
sed -e "s/@[email protected]/$COMMIT/g" > Dockerfile
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