Skip to content

Commit

Permalink
docker: update build (#1375)
Browse files Browse the repository at this point in the history
  • Loading branch information
shumvgolove committed Nov 18, 2022
1 parent a9c2a7d commit 9d7bb06
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions Dockerfile
@@ -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 /

0 comments on commit 9d7bb06

Please sign in to comment.