Skip to content

Commit

Permalink
Merge pull request #520 from lemmarathon/feature/docker
Browse files Browse the repository at this point in the history
Add Dockerfile
  • Loading branch information
atomb authored Jul 6, 2018
2 parents 8496ddf + 7c28253 commit 89cce64
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -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 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 89cce64

Please sign in to comment.