-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[Feature] Rust running environment #8875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
我们先调研一下具体的可行方案,后续版本考虑是否支持该功能。
|
非常感谢,我的后端基本上都使用axum进行了重构,我很需要这个功能 |
以下是一个docker运行rust项目的简单例子 1. 准备 Rust 项目cargo new my_rust_app
cd my_rust_app
echo 'fn main() { println!("Hello from Docker!"); }' > src/main.rs 2. 创建 Dockerfile# 使用官方 Rust 镜像作为构建环境
FROM rust:1.73-slim AS builder
# 设置工作目录
WORKDIR /app
# 复制项目文件
COPY . .
# 构建 Release 版本
RUN cargo build --release
# 使用轻量级运行时镜像
FROM debian:bookworm-slim
# 从构建阶段复制二进制文件
COPY --from=builder /app/target/release/my_rust_app /usr/local/bin
# 设置容器启动命令
CMD ["my_rust_app"] 3. 构建 Docker 镜像docker build -t rust-app . 4. 运行容器docker run --rm rust-app
# 输出: Hello from Docker! 这是我个人rust项目的Dockerfile(供参考)
|
@wanghe-fit2cloud 王哥请问一下,如果需要实现这个功能应该怎么做,直接修改前端部分吗,我没有找到go这边的相应代码 |
@wanghe-fit2cloud Brother Wang, what should I do if I need to implement this function? Do I directly modify the front-end part? I didn’t find the corresponding code on go |
1Panel Version
v1.10.29-lts
Please describe your needs or suggestions for improvements
希望运行环境加入rust
Please describe the solution you suggest
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: