Use libressl from source instead of openssl

Brings down our binary size by another mb

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
baalajimaestro 2022-04-25 11:42:08 +05:30
parent 6d7ecb36a0
commit 1a736e84ce
Signed by: baalajimaestro
GPG key ID: F93C394FE9BBAFD5

View file

@ -1,15 +1,24 @@
FROM nimlang/nim:alpine as builder FROM nimlang/nim:alpine as builder
RUN apk update && apk add git build-base clang llvm llvm-dev lld curl bash openssl openssl-dev openssl-libs-static sqlite-dev sqlite-static RUN apk update && apk add git build-base clang perl autoconf automake libtool llvm llvm-dev lld curl bash openssl sqlite-dev sqlite-static
RUN git clone https://github.com/libressl-portable/portable && \
cd portable && \
./autogen.sh && \
./configure --with-openssldir=/usr/local/libressl --disable-shared &> /dev/null && \
make -j$(nproc) &> /dev/null && \
make install &> /dev/null
COPY . /app COPY . /app
WORKDIR /app 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 \
--passL:-L/usr/local/lib \
-d:ssl \ -d:ssl \
--os:any \ --os:any \
-d:posix \ -d:posix \
-d:libressl \
-d:useMalloc \ -d:useMalloc \
-d:noSignalHandler \ -d:noSignalHandler \
--cc:clang \ --cc:clang \