Do LTO on the binary

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
baalajimaestro 2022-04-25 10:08:24 +05:30
parent c77bc890cb
commit 15dbf2f29d
Signed by: baalajimaestro
GPG key ID: F93C394FE9BBAFD5

View file

@ -1,6 +1,6 @@
FROM nimlang/nim:alpine as builder FROM nimlang/nim:alpine as builder
RUN apk update && apk add git build-base curl bash openssl openssl-dev openssl-libs-static sqlite-dev sqlite-static RUN apk update && apk add git build-base llvm llvm-dev curl bash openssl openssl-dev openssl-libs-static sqlite-dev sqlite-static
COPY . /app COPY . /app
WORKDIR /app WORKDIR /app
@ -8,6 +8,7 @@ WORKDIR /app
# Build with necessary params to enable statically linking openssl, glibc and sqlite3 # Build with necessary params to enable statically linking openssl, glibc and sqlite3
RUN nimble build --passL:-L/usr/lib \ RUN nimble build --passL:-L/usr/lib \
-d:ssl \ -d:ssl \
--cc:clang \
-p:. \ -p:. \
--dynlibOverride:ssl \ --dynlibOverride:ssl \
--dynlibOverride:crypto \ --dynlibOverride:crypto \
@ -16,6 +17,7 @@ RUN nimble build --passL:-L/usr/lib \
--passl:-lsqlite3 \ --passl:-lsqlite3 \
--passl:-lcrypto \ --passl:-lcrypto \
--passL:-static \ --passL:-static \
--passL:-flto=thin \
-d:release \ -d:release \
--opt:speed \ --opt:speed \
--accept --accept