forked from The-OpenROAD-Project/OpenROAD-flow-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#62157] WIP: docker: Dockerfile.builder: Optimize dockerfile
Signed-off-by: Illia Vysochyn <[email protected]>
- Loading branch information
Showing
1 changed file
with
13 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
# 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 fromImage=openroad/flow-ubuntu22.04-dev:latest | ||
ARG numThreads=$(nproc) | ||
|
||
COPY . /OpenROAD-flow-scripts | ||
WORKDIR /OpenROAD-flow-scripts | ||
RUN ./build_openroad.sh --no_init --local --threads ${numThreads} | ||
|
||
# TODO: Prepare long-term dependencies here | ||
FROM $fromImage AS openroad-flow-scripts-base | ||
|
||
COPY . /OpenROAD-flow-scripts | ||
WORKDIR /OpenROAD-flow-scripts | ||
COPY --exclude=.git --exclude=tools/ . /OpenROAD-flow-scripts | ||
|
||
RUN rm -rf /OpenROAD-flow-scripts/tools /OpenROAD-flow-scripts/.git | ||
# TODO: Copy only build dependencies | ||
FROM openroad-flow-scripts-base AS openroad-builder-base | ||
COPY --exclude=.git . /OpenROAD-flow-scripts | ||
RUN ./build_openroad.sh --no_init --local --threads ${numThreads} | ||
|
||
# TODO: Copy remaining files from the repository | ||
FROM openroad-flow-scripts-base AS openroad-flow-scripts-merged | ||
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 | ||
COPY --from=openroad-flow-scripts-merged /OpenROAD-flow-scripts /OpenROAD-flow-scripts | ||
WORKDIR /OpenROAD-flow-scripts |