From 1a736e84ce618ced528e6ba3669469a09ba1d349 Mon Sep 17 00:00:00 2001 From: baalajimaestro Date: Mon, 25 Apr 2022 11:42:08 +0530 Subject: [PATCH] Use libressl from source instead of openssl Brings down our binary size by another mb Signed-off-by: baalajimaestro --- Dockerfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b3bb43e..a8e2d19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,24 @@ 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 WORKDIR /app # Build with necessary params to enable statically linking openssl, glibc and sqlite3 RUN nimble build --passL:-L/usr/lib \ + --passL:-L/usr/local/lib \ -d:ssl \ --os:any \ -d:posix \ + -d:libressl \ -d:useMalloc \ -d:noSignalHandler \ --cc:clang \