kapiti 0.0.3

The Kapiti DNS Server
Documentation
# Builds an image containing the binary and little else.

# Builder image, with openssl added for native-tls, and initial project for Cargo.* deps to build in

FROM docker.io/library/rust:slim
RUN apt-get update \
  && apt-get install -y libssl-dev pkg-config \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists /var/cache/apt/archives \
  && cargo --version \
  && cargo install cargo-build-deps \
  && cd / \
  && cargo new --bin kapiti

COPY . /kapiti
RUN cd /kapiti && cargo build --release

# Release image: copy executable from builder
# Debian version needs to match builder image to avoid linker issues.

FROM docker.io/library/debian:bullseye-slim
RUN apt-get update \
  && apt-get install -y ca-certificates \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists /var/cache/apt/archives
COPY --from=0 /kapiti/target/release/kapiti /kapiti
RUN chmod +x /kapiti && /kapiti --version