From d707a8c8e0318c1dcdfb446b6248bb2c3927fd0e Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Sun, 1 Oct 2023 17:06:48 +0300 Subject: [PATCH] Try with minimized CPU count --- Dockerfile | 3 ++- Makefile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 496a09b..2b1fd48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Makefile b/Makefile index 0f98463..afda179 100644 --- a/Makefile +++ b/Makefile @@ -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