simplex-chat/Dockerfile

33 lines
813 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
2023-11-08 06:50:56 -06:00
RUN ghcup install ghc 9.6.3
2022-11-18 03:00:43 -06:00
# Install cabal
RUN ghcup install cabal 3.10.1.0
2022-11-18 03:00:43 -06:00
# Set both as default
2023-11-08 06:50:56 -06:00
RUN ghcup set ghc 9.6.3 && \
ghcup set cabal 3.10.1.0
2022-11-18 03:00:43 -06:00
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 /