[英]Docker buildx gives exit code: 137 with cargo
我知道退出代碼 137 表示 OOM 異常。 我已經將我的 memory 增加到分配給 Docker 的 12 GB 並重新啟動了我的計算機。 我在運行docker buildx
時仍然收到此錯誤。 常規docker build
完美運行。 我在股票 Mac Studio 上。
這是我失敗的命令:
docker buildx build --platform linux/amd64 -t test4.
日志:
> [builder 4/4] RUN cargo build --release:
#0 1.882 Updating crates.io index
#0 46.86 Killed
------
Dockerfile:8
--------------------
6 | COPY . .
7 |
8 | >>> RUN cargo build --release
9 |
10 | FROM debian:11.5
--------------------
error: failed to solve: process "/bin/sh -c cargo build --release" did not complete successfully: exit code: 137
Dockerfile:
FROM rust:1.65.0-bullseye AS builder
WORKDIR app
COPY . .
RUN cargo build --release
FROM debian:11.5
WORKDIR app
COPY --from=builder ./app/target/release/hello ./hello
CMD ["./hello"]
是Rust寫的hello world程序。
我發現有一個類似的問題: https://github.com/rust-lang/cargo/issues/10781#issuecomment-1163819998 。 使用 nightly 工具鏈並設置 sparse-registry unstable 選項有效。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.