13 lines
706 B
Docker
13 lines
706 B
Docker
FROM docker.io/rustlang/rust:nightly-bullseye-slim as builder
|
|
WORKDIR /usr/src
|
|
COPY . .
|
|
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER="gcc"
|
|
ENV RUSTFLAGS="-C link-arg=-fuse-ld=bfd -C target-cpu=native"
|
|
RUN rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
|
|
RUN cargo -v --color never build --workspace -Z build-std=panic_abort,core,std,alloc,proc_macro \
|
|
-Z build-std-features=panic_immediate_abort --target x86_64-unknown-linux-gnu --release
|
|
|
|
# Second stage putting the build result into a debian jessie-slim image
|
|
FROM debian:bullseye-slim
|
|
COPY --from=builder /usr/src/tcpaste/target/x86_64-unknown-linux-gnu/release/tcp-pasted /usr/local/bin/tcp-pasted
|
|
CMD ["tcp-pasted"]
|