2021-12-30 19:49:27 +00:00
|
|
|
FROM rust:1.57-bullseye as builder
|
2020-05-23 14:29:02 +00:00
|
|
|
|
|
|
|
RUN apt-get update && \
|
2021-12-30 19:49:27 +00:00
|
|
|
apt-get install -y libssl-dev pkg-config
|
2020-05-23 14:29:02 +00:00
|
|
|
|
|
|
|
WORKDIR /srv
|
|
|
|
|
|
|
|
# Build dependencies and cache them
|
|
|
|
COPY Cargo.* ./
|
|
|
|
RUN mkdir -p src && \
|
|
|
|
echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs && \
|
|
|
|
cargo build --release && \
|
|
|
|
rm -r src && \
|
|
|
|
rm target/release/deps/diplonat*
|
|
|
|
|
|
|
|
# Build final app
|
|
|
|
COPY ./src ./src
|
|
|
|
RUN cargo build --release
|
|
|
|
|
|
|
|
FROM debian:bullseye-slim
|
2020-06-28 15:01:12 +00:00
|
|
|
RUN apt-get update && apt-get install -y libssl1.1 iptables
|
2020-05-23 14:29:02 +00:00
|
|
|
COPY --from=builder /srv/target/release/diplonat /usr/local/sbin/diplonat
|
|
|
|
CMD ["/usr/local/sbin/diplonat"]
|