Try with minimized CPU count

This commit is contained in:
Alex Root Junior 2023-10-01 17:06:48 +03:00
parent feb59875fd
commit d707a8c8e0
2 changed files with 3 additions and 2 deletions

View File

@ -5,10 +5,11 @@ WORKDIR /usr/src/telegram-bot-api
RUN apk add --no-cache --update alpine-sdk linux-headers git zlib-dev openssl-dev gperf cmake
COPY telegram-bot-api /usr/src/telegram-bot-api
ARG nproc=1
RUN mkdir -p build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=.. .. \
&& cmake --build . --target install -j $(nproc) \
&& cmake --build . --target install -j ${nproc} \
&& strip /usr/src/telegram-bot-api/bin/telegram-bot-api
FROM alpine:3.18

View File

@ -5,7 +5,7 @@ image_tag := $(shell date +%Y%m%d)
build:
rm -rf telegram-bot-api
git clone --recursive https://github.com/tdlib/telegram-bot-api.git
docker build -t $(image_name):$(image_tag) .
docker build -t $(image_name):$(image_tag) --build-arg nproc=$(shell nproc) .
docker tag $(image_name):$(image_tag) $(image_name):latest
.PHONY: publish