forked from GaloisInc/saw-script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (29 loc) · 1004 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM haskell:8.6 AS build
USER root
# TODO: install Yices, too (and CVC4?, Boolector?)
RUN apt-get update \
&& apt-get install -y wget libncurses-dev unzip \
&& wget https://github.com/Z3Prover/z3/releases/download/z3-4.7.1/z3-4.7.1-x64-debian-8.10.zip \
&& unzip z3*.zip \
&& mv z3-*/bin/z3 /usr/local/bin
RUN useradd -m saw
RUN su -c '/opt/cabal/bin/cabal v2-update' saw
ADD . /home/saw
RUN chown -R saw:saw /home/saw
USER saw
WORKDIR /home/saw
RUN cabal v2-build
WORKDIR /home/saw
RUN mkdir -p rootfs/usr/local/bin \
&& cp /usr/local/bin/z3 rootfs/usr/local/bin/z3 \
&& cp dist-newstyle/build/*-linux/ghc-*/saw-script-*/build/saw/saw rootfs/usr/local/bin/saw
USER root
RUN chown -R root:root /home/saw/rootfs
FROM debian:stretch-slim
RUN apt-get update \
&& apt-get install -y libgmp10 libgomp1 libffi6 wget libncurses5 unzip
COPY --from=build /home/saw/rootfs /
RUN useradd -m saw && chown -R saw:saw /home/saw
USER saw
ENV LANG C.UTF-8
ENTRYPOINT ["/usr/local/bin/saw"]