# This image should be built with the --ssh=default option to use the host's ssh credentials FROM rust:1.67 WORKDIR /app # Build a dummy project to download and build all dependencies first COPY Cargo.toml Cargo.lock ./ RUN mkdir src RUN echo "fn main() {}" > src/main.rs # The --mount=type=ssh option uses the host's ssh credentials RUN --mount=type=ssh cargo build # Now build the repo itself COPY providers providers COPY data_sources.yaml data_sources.yaml COPY src src # Touch the main file so docker doesn't use the cached (dummy) version RUN touch src/main.rs RUN --mount=type=ssh cargo build ENTRYPOINT ["/app/target/debug/fpd"]