Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit e2c6c4c

Browse files
committed
Straightforward build without layer caching
1 parent 933ab87 commit e2c6c4c

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

Dockerfile

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
FROM haskell:8.6 as build
22
WORKDIR /build
3-
RUN cabal new-update
43

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
4+
RUN cabal new-update
135

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
6+
COPY . .
7+
RUN cabal new-build --flags="release" semantic:exe:semantic
188

199
# 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
10+
RUN cp $(find dist-newstyle/build/x86_64-linux -name semantic -type f -perm -u=x) /usr/local/bin/semantic
2111

2212
# Create a fresh image containing only the compiled CLI program, so that the
2313
# image isn't bulked up by all of the extra build state.

0 commit comments

Comments
 (0)