This repository was archived by the owner on Apr 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ Dockerfile
Original file line number Diff line number Diff line change 1+ FROM haskell:8.6 as build
2+ WORKDIR /build
3+ RUN cabal new-update
4+
5+ # Build our upstream dependencies after copying in only enough to tell cabal
6+ # what they are. This will make these layers cache better even as we change the
7+ # code of semantic itself.
8+ COPY semantic.cabal .
9+ COPY cabal.project .
10+ COPY semantic-core/semantic-core.cabal ./semantic-core/
11+ COPY vendor ./vendor
12+ RUN cabal new-build --only-dependencies
13+
14+ # Once the dependencies are built, copy in the rest of the code and compile
15+ # semantic itself.
16+ COPY . /build
17+ RUN cabal new-build semantic:exe:semantic
18+
19+ # A fake `install` target until we can get `cabal new-install` to work
20+ RUN cp $(find dist-newstyle -name semantic -type f -perm -u=x) /usr/local/bin/semantic
21+
22+ # Create a fresh image containing only the compiled CLI program, so that the
23+ # image isn't bulked up by all of the extra build state.
24+ FROM debian:stretch-slim
25+
26+ RUN apt-get update && \
27+ apt-get install -y \
28+ libgmp10 \
29+ && \
30+ apt-get autoremove -y && \
31+ apt-get clean -y && \
32+ rm -rf /var/lib/apt/lists/*
33+
34+ COPY --from=build /usr/local/bin/semantic /usr/local/bin/semantic
35+
36+ ENTRYPOINT ["/usr/local/bin/semantic" ]
You can’t perform that action at this time.
0 commit comments