mirror of
https://github.com/wisdgod/cursor-api.git
synced 2025-10-06 23:22:48 +08:00
30 lines
894 B
Docker
30 lines
894 B
Docker
# Dockerfile.cross
|
|
|
|
FROM --platform=linux/amd64 rust:1.84.0-slim-bookworm
|
|
|
|
WORKDIR /app
|
|
|
|
# 安装必要的软件包
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
pkg-config \
|
|
libssl-dev \
|
|
protobuf-compiler \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# 设置环境变量 (如果需要)
|
|
# ENV RUSTFLAGS="-C link-arg=-s"
|
|
|
|
# 设置 PROTOC 环境变量 (因为你的 build.rs 需要)
|
|
ENV PROTOC=/usr/bin/protoc
|
|
|
|
# 安装特定版本的 protoc (如果你需要特定版本,例如 29.3;否则可以删除这部分)
|
|
# ENV PROTOC_VERSION=29.3
|
|
# ENV PROTOC_ZIP=protoc-${PROTOC_VERSION}-linux-x86_64.zip
|
|
# RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP} -O /tmp/${PROTOC_ZIP} && \
|
|
# unzip /tmp/${PROTOC_ZIP} -d /usr && \
|
|
# rm /tmp/${PROTOC_ZIP}
|
|
|
|
# 验证安装
|
|
RUN protoc --version |