Build nim from source instead of prebuilts

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
baalajimaestro 2023-05-31 10:57:11 +05:30
parent 364d2a9121
commit eea438b3ab
Signed by: baalajimaestro
GPG key ID: F93C394FE9BBAFD5

View file

@ -1,4 +1,4 @@
FROM nimlang/nim:alpine as builder
FROM alpine:edge as builder
RUN apk update && apk add git \
build-base \
@ -10,11 +10,20 @@ RUN apk update && apk add git \
sqlite-dev \
sqlite-static
COPY . /app
WORKDIR /app
ENV NIM_VERSION v1.6.12
RUN git clone https://github.com/nim-lang/Nim.git --depth=1 -b ${NIM_VERSION} && \
cd Nim && \
bash build_all.sh
# Add built nim to path
ENV PATH=/Nim/bin:$PATH
RUN nimble install nimble --accept
COPY . /app
WORKDIR /app
# Build with necessary params to enable statically linking openssl, glibc and sqlite3
RUN /root/.nimble/bin/nimble build --passL:-L/usr/lib \
-d:ssl \