-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (29 loc) · 1.18 KB
/
Dockerfile
File metadata and controls
43 lines (29 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM debian:12 AS builder-stage
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y git make git zlib1g-dev libssl-dev gperf php-cli cmake default-jdk g++
RUN git clone https://github.com/tdlib/td.git
WORKDIR /td
# 1.8.50
RUN git checkout e133ac6d049f5d56821cec6a3e5501cb20965c66
RUN mkdir build
WORKDIR /td/build
RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../example/java/td -DTD_ENABLE_JNI=ON ..
RUN cmake --build . --target install
RUN mkdir /td/example/java/build
WORKDIR /td/example/java/build
RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../../../tdlib -DTd_DIR:PATH=$(readlink -e ../td/lib/cmake/Td) ..
RUN cmake --build . --target install
WORKDIR /td/tdlib/bin
# creating jar file
RUN rm -Rf org/drinkless/tdlib/example
RUN mkdir jar
RUN mv org/ jar/
RUN jar cf tdlib.jar -C jar .
# patching jar to add module-info.java
COPY module-info.java /td/tdlib/bin/
RUN javac --patch-module org.drinkless.tdlib=tdlib.jar module-info.java
RUN jar uf tdlib.jar module-info.class
# copying the files to the target directory
FROM scratch
COPY --from=builder-stage /td/tdlib/bin/tdlib.jar /
COPY --from=builder-stage /td/tdlib/bin/libtdjni.so /