IT notes

rust strip

To build && strip a binary use: RUSTFLAGS='-C link-arg=-s' cargo build --release strip removes or modifies the symbol table attached to the output of the assembler and link editor. This is useful to save space after a program has been debugged and to limit dynamically bound symbols.

rust docker

Dockerfile to create small rust docker images: FROM clux/muslrust RUN mkdir /source WORKDIR /source COPY . . RUN cargo build --release RUN strip ./target/x86_64-unknown-linux-musl/release/myapp FROM scratch COPY --from=0 /source/target/x86_64-unknown-linux-musl/release/myapp / CMD ["./myapp"] Image compatible with cloud foundry: FROM rust:1.35 WORKDIR /usr/src/myapp COPY . . RUN cargo build --release FROM debian:latest RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y openssl ca-certificates COPY --from=0 /usr/src/myapp/target/release/myapp / CMD ["./myapp"]