3 ms·
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 somet
by duped 1y ago
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.
- edude03 1y agoMany docker users develop on arm64-darwin and deploy to x86_64 (g)libc, so I don't think that'll work generally.
- duped 1y agoThose users are wrong :shrug:
- remram 1y agoThe author dismissed that option saying "I value that docker build can have a clean environment every time", so this is self-inflicted.