docker: update build (#1375)
This commit is contained in:
parent
a9c2a7dcaa
commit
9d7bb06396
31
Dockerfile
31
Dockerfile
@ -1,10 +1,29 @@
|
|||||||
FROM haskell:8.10.4 AS build-stage
|
FROM ubuntu:focal AS build
|
||||||
# if you encounter "version `GLIBC_2.28' not found" error when running
|
|
||||||
# chat client executable, build with the following base image instead:
|
# Install curl and simplex-chat-related dependencies
|
||||||
# FROM haskell:8.10.4-stretch AS build-stage
|
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
|
COPY . /project
|
||||||
WORKDIR /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
|
FROM scratch AS export-stage
|
||||||
COPY --from=build-stage /root/.local/bin/simplex-chat /
|
COPY --from=build /root/.cabal/bin/simplex-chat /
|
||||||
|
Loading…
Reference in New Issue
Block a user