Add Dockerfile.

This commit is contained in:
lemmarathon 2018-06-26 14:10:28 -04:00
parent fe4b2d9f70
commit 7c282538ea
2 changed files with 69 additions and 0 deletions

34
.dockerignore Normal file
View File

@ -0,0 +1,34 @@
*\#*
*~
.DS_Store
.cabal-sandbox
cabal.sandbox.config
dist
results.xml
dist-newstyle
.stack-work
.ghc.environment.x86_64-darwin-8.2.2
# don't check in generated documentation
#docs/CryptolPrims.pdf
#docs/ProgrammingCryptol.pdf
#docs/Syntax.pdf
#docs/Version2Changes.pdf
# don't check in distribution files
cryptol-2.*
# temporary notebook stuff until we split out the repo
/ICryptol/ICryptol-2.*
/ICryptol/profile.tar
/ICryptol/profile_cryptol/security/
/ICryptol/profile_cryptol/startup/
/bench*.xml
# vim swap files
.*.swp
.*.swo
Dockerfile*
.git
.gitignore

35
Dockerfile Normal file
View File

@ -0,0 +1,35 @@
FROM alpine:edge AS build
RUN adduser -D cryptol \
&& apk add -X http://dl-cdn.alpinelinux.org/alpine/edge/testing z3 \
&& rm /usr/lib/libz3.so* \
&& apk add build-base cabal ghc wget ncurses-dev \
&& su -c 'cabal update' cryptol
COPY --chown=cryptol:cryptol . /cryptol
USER cryptol
WORKDIR /cryptol
ARG CRYPTOLPATH="/home/cryptol/.cryptol"
ARG TESTS="modsys parser issues regression renamer mono-binds"
ARG DIFF="diff"
ARG IGNORE_EXPECTED="--ignore-expected"
ARG CABAL_BUILD_FLAGS="-j"
ARG CABAL_INSTALL_FLAGS="${CABAL_BUILD_FLAGS}"
RUN make tarball
RUN make test
RUN mkdir -p rootfs/"${CRYPTOLPATH}" \
&& cp -r lib/* rootfs/"${CRYPTOLPATH}" \
&& mkdir -p rootfs/usr/local \
&& rm -r cryptol-*-Linux-*_unknown/share/doc \
&& mv cryptol-*-Linux-*_unknown/* rootfs/usr/local
USER root
RUN chown -R root:root /cryptol/rootfs
FROM alpine:edge
COPY --from=build /cryptol/rootfs /
RUN adduser -D 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/*
USER cryptol
ENTRYPOINT ["/usr/local/bin/cryptol"]