-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try building and pushing docker image
- Loading branch information
Showing
2 changed files
with
137 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
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 @@ | ||
# inspired by https://github.com/phadej/docker-haskell-example/blob/master/Dockerfile | ||
FROM haskell:9.6.3 as build | ||
|
||
RUN apt-get update -y && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y automake build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw5 libtool autoconf | ||
|
||
COPY ./cabal.project /app/cabal.project | ||
|
||
RUN mkdir /app/leios-sim | ||
|
||
COPY ./leios-sim/leios-sim.cabal /app/leios-sim/leios-sim.cabal | ||
|
||
WORKDIR /app | ||
|
||
RUN cabal update | ||
RUN cabal build --dependencies-only all | ||
|
||
COPY . /app | ||
|
||
RUN cabal build all | ||
|
||
# Make final binary a bit smaller | ||
RUN strip dist-newstyle/build/x86_64-linux/ghc-9.6.3/leios-0.1.0.0/x/leios/noopt/build/leios/leios | ||
|
||
FROM ubuntu:22.04 | ||
|
||
WORKDIR /app | ||
EXPOSE 8091 | ||
|
||
COPY --from=build /app/leios-sim/* /app/ | ||
COPY --from=build /app/dist-newstyle/build/x86_64-linux/ghc-9.6.3/leios-0.1.0.0/x/leios/noopt/build/leios/leios /app | ||
|
||
ENTRYPOINT ["/app/leios"] |