From dce23275b5eb1f59c69b8847137fbe43befb4356 Mon Sep 17 00:00:00 2001 From: hanshal101 Date: Thu, 7 Aug 2025 13:05:32 +0530 Subject: [PATCH] fix: dockerfile and startup script for orion proxy Signed-off-by: hanshal101 --- docker/Dockerfile | 71 ++++++++++++++++++++++++++++--------------- docker/start_proxy.sh | 12 ++++---- 2 files changed, 52 insertions(+), 31 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index b255629f..86767edd 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,43 +1,64 @@ +# Stage 1: The Builder FROM rust:1.84 AS orion-builder -#RUN rustup component add rustfmt +# install build-time dependencies for the Rust application. +RUN apt-get update && \ + apt-get install -y protobuf-compiler && \ + rm -rf /var/lib/apt/lists/* +# set the working directory inside the container. WORKDIR /tmp/orion -RUN < src/main.rs -COPY ./orion-xds ./orion-xds -COPY ./orion-proxy ./orion-proxy -COPY ./orion-data-plane-api ./orion-data-plane-api -COPY ./orion-error ./orion-error -COPY ./orion-lib ./orion-lib -COPY ./envoy-data-plane-api ./envoy-data-plane-api -COPY ./orion-configuration ./orion-configuration +RUN set -e; \ + for member in \ + orion-lib \ + orion-xds \ + orion-proxy \ + orion-error \ + orion-configuration \ + orion-data-plane-api \ + envoy-data-plane-api; \ + do \ + mkdir -p "${member}/src"; \ + printf '[package]\nname = "%s"\nversion = "0.1.0"\nedition = "2021"\n\n[lib]\npath = "src/lib.rs"\n' \ + "${member}" > "${member}/Cargo.toml"; \ + touch "${member}/src/lib.rs"; \ + done +# fetch and download all dependencies defined in Cargo.lock. +RUN cargo fetch -COPY rustfmt.toml ./ -COPY Cargo.toml ./ -COPY Cargo.lock ./ - +# copy the rest of the application source code. +COPY . . +# build the application in release mode for performance. RUN cargo build --release -### Split into two files; one to build and one to actually run it -###https://docs.docker.com/develop/develop-images/multistage-build/ - +# Stage 2: The Final Runtime Image FROM debian:bookworm-slim -RUN <