mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-09-11 14:06:13 +03:00
Update Docker build to use Debian as a base
This makes it easier to do Haskell builds and incorporate external tools, even though it results in a slightly bigger image.
This commit is contained in:
parent
6a268930c8
commit
f1f7ca311c
27
Dockerfile
27
Dockerfile
@ -1,9 +1,11 @@
|
|||||||
FROM alpine:edge AS build
|
FROM haskell:8.6 AS build
|
||||||
RUN adduser -D cryptol \
|
RUN apt-get update \
|
||||||
&& apk add -X http://dl-cdn.alpinelinux.org/alpine/edge/testing z3 \
|
&& apt-get install -y wget libncurses-dev unzip \
|
||||||
&& rm /usr/lib/libz3.so* \
|
&& wget https://github.com/Z3Prover/z3/releases/download/z3-4.8.4/z3-4.8.4.d6df51951f4c-x64-debian-8.11.zip \
|
||||||
&& apk add build-base cabal ghc wget ncurses-dev \
|
&& unzip z3*.zip \
|
||||||
&& su -c 'cabal update' cryptol
|
&& mv z3-*/bin/z3 /usr/local/bin
|
||||||
|
RUN useradd -m cryptol \
|
||||||
|
&& su -c '/opt/cabal/bin/cabal v2-update' cryptol
|
||||||
COPY --chown=cryptol:cryptol . /cryptol
|
COPY --chown=cryptol:cryptol . /cryptol
|
||||||
USER cryptol
|
USER cryptol
|
||||||
WORKDIR /cryptol
|
WORKDIR /cryptol
|
||||||
@ -14,22 +16,23 @@ ARG IGNORE_EXPECTED="--ignore-expected"
|
|||||||
ARG CABAL_BUILD_FLAGS="-j"
|
ARG CABAL_BUILD_FLAGS="-j"
|
||||||
ARG CABAL_INSTALL_FLAGS="${CABAL_BUILD_FLAGS}"
|
ARG CABAL_INSTALL_FLAGS="${CABAL_BUILD_FLAGS}"
|
||||||
RUN make tarball
|
RUN make tarball
|
||||||
|
ARG TIME=""
|
||||||
RUN make test
|
RUN make test
|
||||||
RUN mkdir -p rootfs/"${CRYPTOLPATH}" \
|
RUN mkdir -p rootfs/"${CRYPTOLPATH}" \
|
||||||
&& cp -r lib/* rootfs/"${CRYPTOLPATH}" \
|
&& cp -r lib/* rootfs/"${CRYPTOLPATH}" \
|
||||||
&& mkdir -p rootfs/usr/local \
|
&& mkdir -p rootfs/usr/local \
|
||||||
&& rm -r cryptol-*-Linux-*_unknown/share/doc \
|
&& rm -r cryptol-*-Linux-*_unknown/share/doc \
|
||||||
&& mv cryptol-*-Linux-*_unknown/* rootfs/usr/local
|
&& mv cryptol-*-Linux-*_unknown/* rootfs/usr/local \
|
||||||
|
&& mv /usr/local/bin/z3 rootfs/usr/local/bin/z3
|
||||||
USER root
|
USER root
|
||||||
RUN chown -R root:root /cryptol/rootfs
|
RUN chown -R root:root /cryptol/rootfs
|
||||||
|
|
||||||
FROM alpine:edge
|
FROM debian:stretch-slim AS build
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y libgmp10 libffi6 wget libncurses5 unzip
|
||||||
COPY --from=build /cryptol/rootfs /
|
COPY --from=build /cryptol/rootfs /
|
||||||
RUN adduser -D cryptol \
|
RUN useradd -m cryptol \
|
||||||
&& chown -R cryptol:cryptol /home/cryptol \
|
&& chown -R cryptol:cryptol /home/cryptol \
|
||||||
&& apk add -X http://dl-cdn.alpinelinux.org/alpine/edge/testing z3 \
|
|
||||||
&& rm /usr/lib/libz3.so* \
|
|
||||||
&& apk add gmp libffi musl ncurses-libs \
|
|
||||||
&& rm -r /var/cache/apk/*
|
&& rm -r /var/cache/apk/*
|
||||||
USER cryptol
|
USER cryptol
|
||||||
ENTRYPOINT ["/usr/local/bin/cryptol"]
|
ENTRYPOINT ["/usr/local/bin/cryptol"]
|
||||||
|
Loading…
Reference in New Issue
Block a user