linkerd2/proxy/Dockerfile-deps

36 lines
1.3 KiB
Plaintext

# Proxy dependencies
#
# Fetches all required rust dependencies and caches library artifacts. All Conduit sources
# are omitted from the resulting image so that artifacts may be built from source over
# this image.
#
# When this file is changed, you must run `bin/update-go-deps-shas`.
# Compile the application to ensure we've obtained all build dependencies and that they
# compile.
FROM rust:1.23.0 as build
WORKDIR /usr/src/conduit
COPY codegen ./codegen
COPY futures-mpsc-lossy ./futures-mpsc-lossy
COPY tower-h2 ./tower-h2
COPY tower-router ./tower-router
COPY tower-grpc-examples ./tower-grpc-examples
COPY tower-grpc-build ./tower-grpc-build
COPY tower-grpc ./tower-grpc
COPY Cargo.toml Cargo.lock ./
COPY proto ./proto
COPY proxy ./proxy
RUN cargo fetch --locked
RUN cargo build --frozen -p conduit-proxy
RUN cargo build --frozen -p conduit-proxy --release
# Preserve dependency sources and build artifacts without maintaining conduit
# sources/artifacts.
FROM rust:1.23.0
WORKDIR /usr/src/conduit
COPY --from=build $CARGO_HOME $CARGO_HOME
COPY --from=build /usr/src/conduit/target/debug/deps target/debug/deps
COPY --from=build /usr/src/conduit/target/release/deps target/release/deps
COPY --from=build /usr/src/conduit/Cargo.toml Cargo.toml
COPY --from=build /usr/src/conduit/Cargo.lock Cargo.lock