I know exit code 137 represents an OOM exception. I raised already my memory to 12 GB allocated to Docker and restarted my computer. I am still getting this error while running docker buildx
. The regular docker build
works perfectly. I am on a stock Mac Studio.
This is my failing command:
docker buildx build --platform linux/amd64 -t test4 .
Logs:
> [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"]
It is a hello world program written in Rust.