-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #520 from lemmarathon/feature/docker
Add Dockerfile
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |