Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9c2a7d
commit 9d7bb06
Showing
1 changed file
with
25 additions
and
6 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 |
---|---|---|
@@ -1,10 +1,29 @@ | ||
FROM haskell:8.10.4 AS build-stage | ||
# if you encounter "version `GLIBC_2.28' not found" error when running | ||
# chat client executable, build with the following base image instead: | ||
# FROM haskell:8.10.4-stretch AS build-stage | ||
FROM ubuntu:focal AS build | ||
|
||
# Install curl and simplex-chat-related dependencies | ||
RUN apt-get update && apt-get install -y curl git build-essential libgmp3-dev zlib1g-dev | ||
|
||
# Install ghcup | ||
RUN a=$(arch); curl https://downloads.haskell.org/~ghcup/$a-linux-ghcup -o /usr/bin/ghcup && \ | ||
chmod +x /usr/bin/ghcup | ||
|
||
# Install ghc | ||
RUN ghcup install ghc 8.10.7 | ||
# Install cabal | ||
RUN ghcup install cabal | ||
# Set both as default | ||
RUN ghcup set ghc 8.10.7 && \ | ||
ghcup set cabal | ||
|
||
COPY . /project | ||
WORKDIR /project | ||
RUN stack install | ||
|
||
# Adjust PATH | ||
ENV PATH="/root/.cabal/bin:/root/.ghcup/bin:$PATH" | ||
|
||
# Compile simplex-chat | ||
RUN cabal update | ||
RUN cabal install | ||
|
||
FROM scratch AS export-stage | ||
COPY --from=build-stage /root/.local/bin/simplex-chat / | ||
COPY --from=build /root/.cabal/bin/simplex-chat / |