From 5bfcde887ace234936dbe565e793e058dc671fce Mon Sep 17 00:00:00 2001 From: Illia Vysochyn Date: Mon, 8 Jul 2024 18:19:30 +0200 Subject: [PATCH] [#62157] WIP: docker: Dockerfile.builder: Optimize dockerfile Signed-off-by: Illia Vysochyn --- docker/Dockerfile.builder | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/docker/Dockerfile.builder b/docker/Dockerfile.builder index ee21b22356..55209c30a9 100644 --- a/docker/Dockerfile.builder +++ b/docker/Dockerfile.builder @@ -1,27 +1,32 @@ +# syntax=docker/dockerfile:1.7-labs + # Target with dependencies to build all flow tools from their sources. # i.e., "./build_openroad.sh --local" from inside a docker container # NOTE: don't use this file directly unless you know what you are doing, # instead use etc/DockerHelper.sh + ARG fromImage=openroad/flow-ubuntu22.04-dev:latest FROM $fromImage AS openroad-builder-base - ARG numThreads=$(nproc) -COPY . /OpenROAD-flow-scripts -WORKDIR /OpenROAD-flow-scripts - -RUN ./build_openroad.sh --no_init --local --threads ${numThreads} - -FROM $fromImage AS openroad-flow-scripts-base - -COPY . /OpenROAD-flow-scripts - -RUN rm -rf /OpenROAD-flow-scripts/tools /OpenROAD-flow-scripts/.git - -COPY --from=openroad-builder-base /OpenROAD-flow-scripts/tools/install /OpenROAD-flow-scripts/tools/install - -FROM $fromImage - -COPY --from=openroad-flow-scripts-base /OpenROAD-flow-scripts /OpenROAD-flow-scripts WORKDIR /OpenROAD-flow-scripts +COPY --link dev_env.sh dev_env.sh +COPY --link build_openroad.sh build_openroad.sh +COPY --link tools tools +COPY --link --exclude=**/FETCH_HEAD .git/modules .git/modules/ + +RUN <