Commit 2aa0ef99 authored by Jun Furuse's avatar Jun Furuse

Dockerfile for small images (110MB)

parent df2382e0
Pipeline #114311669 passed with stage
in 8 minutes and 52 seconds
......@@ -23,52 +23,41 @@ 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
# 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 @[email protected]
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
WORKDIR /scaml
RUN eval $(opam env) && scamlc src/tests/app_vote.ml && echo OK
RUN du -sh /usr /scaml /root /var
RUN rm -rf /opam
RUN (cd /scaml; opam clean)
RUN opam clean
RUN rm -rf /scaml/_opam/.opam-switch
RUN du -sh /usr /scaml /root
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 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
RUN apt remove -y ocaml g++ git gcc bubblewrap ca-certificates cpp-7
RUN apt-get clean
RUN apt remove -y '*-dev' > /dev/null 2>&1
RUN apt remove -y curl perl make
RUN apt autoremove -y
RUN rm -rf /var/lib/apt
RUN du -sh /usr /scaml /root /var
# That's all
RUN SCAMLIB=/scaml/_opam/lib/scaml /scaml/_opam/bin/scamlc /scaml/src/tests/app_vote.ml && echo OK
#!/bin/bash
set -e
COMMIT=$1
if [ -z $COMMIT ]; then
echo "Must specify the commit"
exit 2
fi
sed -e "s/@[email protected]/$COMMIT/g" Dockerfile.in > Dockerfile
docker build --squash=true -t dailambda/scaml:$COMMIT .
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