From 19df81bbe8bc7aad9149427d1870ea1c38823859 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Wed, 26 May 2021 09:17:04 +0100 Subject: [PATCH] Compress the final binary to decrease the size of docker image. --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3fc52aa..212a10f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ FROM alpine:latest as buildBase -RUN apk add --no-cache alpine-sdk linux-headers git zlib-dev openssl-dev gperf php cmake +RUN apk add --no-cache upx alpine-sdk linux-headers git zlib-dev openssl-dev gperf php cmake ADD . /srv WORKDIR /srv RUN git submodule update --init --recursive && mkdir -p build && cd build && cmake -DCMAKE_INSTALL_PREFIX:PATH=../tdlib -DCMAKE_BUILD_TYPE=Release .. RUN cd /srv/build && cmake --build . --target install +RUN upx --best /srv/build/telegram-bot-api FROM alpine:latest RUN apk add --no-cache zlib-dev openssl-dev libstdc++