←back to thread

302 points Bogdanp | 1 comments | | HN request time: 0.871s | source
Show context
duped ◴[] No.44391878[source]
A lot of people are replying to the title instead of the article.

> To get your Rust program in a container, the typical approach you might find would be something like:

If you have `cargo build --target x86_64-unknown-linux-musl` in your build process you do not need to do this anywhere in your Dockerfile. You should compile and copy into /sbin or something.

If you really want to build in a docker image I would suggest using `cargo --target-dir=/target ...` and then run with `docker run --mount type-bind,...` and then copy out of the bind mount into /bin or wherever.

replies(2): >>44392969 #>>44397078 #
edude03 ◴[] No.44392969[source]
Many docker users develop on arm64-darwin and deploy to x86_64 (g)libc, so I don't think that'll work generally.
replies(1): >>44393275 #
1. duped ◴[] No.44393275[source]
Those users are wrong :shrug: