Skip to content

Commit 822d3b0

Browse files
authored
Merge pull request #2135 from antmicro/ivysochyn/further-optimize-docker
ORFS Dockerfile incremental optimization
2 parents 65da6fc + 3a56190 commit 822d3b0

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

docker/Dockerfile.builder

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,42 @@
1+
# syntax=docker/dockerfile:1.7-labs
2+
13
# Target with dependencies to build all flow tools from their sources.
24
# i.e., "./build_openroad.sh --local" from inside a docker container
35
# NOTE: don't use this file directly unless you know what you are doing,
46
# instead use etc/DockerHelper.sh
7+
58
ARG fromImage=openroad/flow-ubuntu22.04-dev:latest
69

7-
FROM $fromImage AS openroad-builder-base
10+
FROM $fromImage AS orfs-base
811

9-
ARG numThreads=$(nproc)
10-
11-
COPY . /OpenROAD-flow-scripts
1212
WORKDIR /OpenROAD-flow-scripts
13+
COPY --link dev_env.sh dev_env.sh
14+
COPY --link build_openroad.sh build_openroad.sh
1315
14-
RUN ./build_openroad.sh --no_init --local --threads ${numThreads}
15-
16-
FROM $fromImage AS openroad-flow-scripts-base
16+
FROM orfs-base AS orfs-builder-base
1717
18-
COPY . /OpenROAD-flow-scripts
19-
20-
RUN rm -rf /OpenROAD-flow-scripts/tools /OpenROAD-flow-scripts/.git
21-
22-
COPY --from=openroad-builder-base /OpenROAD-flow-scripts/tools/install /OpenROAD-flow-scripts/tools/install
23-
24-
FROM $fromImage
18+
COPY --link tools tools
19+
ARG numThreads=$(nproc)
2520
26-
COPY --from=openroad-flow-scripts-base /OpenROAD-flow-scripts /OpenROAD-flow-scripts
27-
WORKDIR /OpenROAD-flow-scripts
21+
RUN echo "" > tools/yosys/abc/.gitcommit && \
22+
./build_openroad.sh --no_init --local --threads ${numThreads}
23+
24+
FROM orfs-base
25+
26+
# The order for copying the directories is based on the frequency of changes (ascending order),
27+
# and the layer size (descending order)
28+
COPY --link docker docker
29+
COPY --link flow/tutorials flow/tutorials
30+
COPY --link docs docs
31+
COPY --link flow/test flow/test
32+
COPY --link flow/platforms flow/platforms
33+
COPY --link flow/util flow/util
34+
COPY --link flow/scripts flow/scripts
35+
COPY --link flow/designs flow/designs
36+
37+
COPY --link --from=orfs-builder-base /OpenROAD-flow-scripts/tools/install tools/install
38+
COPY --link \
39+
--exclude=.git* --exclude=tools/ --exclude=docs/ --exclude=docker/ \
40+
--exclude=flow/designs --exclude=flow/platforms --exclude=flow/scripts \
41+
--exclude=flow/test --exclude=flow/tutorials --exclude=flow/util \
42+
. ./

0 commit comments

Comments
 (0)