This repository was archived by the owner on Apr 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 11FROM haskell:8.6 as build
22WORKDIR /build
33RUN 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 /build/
9+ COPY cabal.project /build/
10+ COPY semantic-core/semantic-core.cabal /build/semantic-core/
11+ COPY vendor /build/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.
416COPY . /build
517RUN cabal new-build semantic:exe:semantic
618
719# A fake `install` target until we can get `cabal new-install` to work
8- RUN cp $(find dist-newstyle -name semantic -type f -perm -u=x) /semantic
20+ RUN cp $(find dist-newstyle -name semantic -type f -perm -u=x) /usr/local/bin/ semantic
921
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.
1024FROM debian:stretch
1125RUN apt-get update && \
1226 apt-get install -y \
@@ -15,5 +29,5 @@ RUN apt-get update && \
1529 apt-get autoremove -y && \
1630 apt-get clean -y && \
1731 rm -rf /var/lib/apt/lists/*
18- COPY --from=build /semantic /usr/local/bin/semantic
32+ COPY --from=build /usr/local/bin/ semantic /usr/local/bin/semantic
1933ENTRYPOINT ["/usr/local/bin/semantic" ]
You can’t perform that action at this time.
0 commit comments