5 ms·
Rust in Production with Docker
- vkjv 8y agoI highly recommend using multi-stage builds to move the rust binary to a clean container. The rust build tool chain is fairly heavy and is unnecessary at runtime. It can be as simple as adding something like this at the end of your Dockerfile. FROM debian:jessie-slim COPY --from=0 /src/target/release/my-bin /usr/bin/my-bin ENTRYPOINT ["my-bin"]