simplex-chat/Dockerfile

33 lines
797 B
Docker
Raw Normal View History

2022-11-18 03:00:43 -06:00
FROM ubuntu:focal AS build
# Install curl and simplex-chat-related dependencies
2022-11-20 05:56:01 -06:00
RUN apt-get update && apt-get install -y curl git build-essential libgmp3-dev zlib1g-dev libssl-dev
2022-11-18 03:00:43 -06:00
# 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
2022-11-18 03:00:43 -06:00
# Adjust PATH
ENV PATH="/root/.cabal/bin:/root/.ghcup/bin:$PATH"
2022-11-20 05:56:01 -06:00
# Adjust build
RUN cp ./scripts/cabal.project.local.linux ./cabal.project.local
2022-11-18 03:00:43 -06:00
# Compile simplex-chat
RUN cabal update
RUN cabal install
FROM scratch AS export-stage
2022-11-18 03:00:43 -06:00
COPY --from=build /root/.cabal/bin/simplex-chat /