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