-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.loongarch
50 lines (30 loc) · 1.36 KB
/
Dockerfile.loongarch
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
44
45
46
47
48
49
50
FROM cr.loongnix.cn/library/python:3.11.9-slim-buster
LABEL authors="fsj"
USER root
ARG RUST_INSTALL_PACKAGE=rust-1.80.0-loongarch64-linux.tar.xz
WORKDIR /
RUN apt update
RUN apt install -y gcc make libpq-dev libffi-dev libmagic1 g++ wget libssl-dev pkg-config zlib1g-dev
RUN wget https://lib.storage.pigeon-server.cn/$RUST_INSTALL_PACKAGE
RUN mkdir rust-install
RUN tar -xvf $RUST_INSTALL_PACKAGE -C rust-install
RUN ./rust-install/install.sh
RUN rm $RUST_INSTALL_PACKAGE
RUN rm -rf ./rust-install
RUN mkdir -p /root/.cargo && \
echo "[source.crates-io]" > /root/.cargo/config.toml && \
echo "replace-with = 'mirror'" >> /root/.cargo/config.toml && \
echo "" >> /root/.cargo/config.toml && \
echo "[source.mirror]" >> /root/.cargo/config.toml && \
echo "registry = \"sparse+https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/\"" >> /root/.cargo/config.toml
COPY . /build
WORKDIR /build
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip install pyinstaller cryptography==42.0.8
RUN pip install -r requirements.txt
# 使用PyInstaller将Python脚本打包成可执行文件
RUN pyinstaller --onefile main.py -n loongarch64-ServerManager-Node.bin
# 将生成的可执行文件复制到 /output 目录
RUN mkdir /output && cp /build/dist/main /output
# 定义容器启动时执行的命令
CMD ["echo", "Build complete"]