perf(docker): limiting the number of layers on target images

Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
This commit is contained in:
Raphael Defosseux
2021-12-03 09:24:33 +01:00
committed by Robert Schmidt
parent 0ac69fb164
commit b2d440645f
14 changed files with 416 additions and 343 deletions
+46 -50
View File
@@ -37,7 +37,6 @@ RUN /bin/sh oaienv && \
mkdir -p log && \
./build_oai --phy_simulators --ninja --verbose-ci
#start from scratch for target executable
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-physim
@@ -45,6 +44,7 @@ RUN yum update -y && \
yum install -y --enablerepo="ubi-8-codeready-builder" \
lksctp-tools \
nettle \
tzdata \
atlas \
hostname \
sudo \
@@ -58,66 +58,62 @@ RUN yum update -y && \
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
WORKDIR /opt/oai-physim/targets/bin
COPY --from=phy-sim-build /oai-ran/targets/bin/dlsim.Rel15 .
COPY --from=phy-sim-build /oai-ran/targets/bin/nr_dlsim.Rel15 .
COPY --from=phy-sim-build /oai-ran/targets/bin/nr_prachsim.Rel15 .
COPY --from=phy-sim-build /oai-ran/targets/bin/nr_ulschsim.Rel15 .
COPY --from=phy-sim-build /oai-ran/targets/bin/polartest.Rel15 .
COPY --from=phy-sim-build /oai-ran/targets/bin/ulsim.Rel15 .
COPY --from=phy-sim-build /oai-ran/targets/bin/ldpctest.Rel15 .
COPY --from=phy-sim-build /oai-ran/targets/bin/nr_dlschsim.Rel15 .
COPY --from=phy-sim-build /oai-ran/targets/bin/nr_pbchsim.Rel15 .
COPY --from=phy-sim-build /oai-ran/targets/bin/nr_pucchsim.Rel15 .
COPY --from=phy-sim-build /oai-ran/targets/bin/nr_ulsim.Rel15 .
COPY --from=phy-sim-build /oai-ran/targets/bin/smallblocktest.Rel15 .
COPY --from=phy-sim-build \
/oai-ran/targets/bin/dlsim.Rel15 \
/oai-ran/targets/bin/nr_dlsim.Rel15 \
/oai-ran/targets/bin/nr_prachsim.Rel15 \
/oai-ran/targets/bin/nr_ulschsim.Rel15 \
/oai-ran/targets/bin/polartest.Rel15 \
/oai-ran/targets/bin/ulsim.Rel15 \
/oai-ran/targets/bin/ldpctest.Rel15 \
/oai-ran/targets/bin/nr_dlschsim.Rel15 \
/oai-ran/targets/bin/nr_pbchsim.Rel15 \
/oai-ran/targets/bin/nr_pucchsim.Rel15 \
/oai-ran/targets/bin/nr_ulsim.Rel15 \
/oai-ran/targets/bin/smallblocktest.Rel15 \
./
WORKDIR /usr/local/lib/
COPY --from=phy-sim-build /oai-ran/targets/bin/libcoding.so .
COPY --from=phy-sim-build /lib64/liblapacke.so.3 .
COPY --from=phy-sim-build /lib64/libX11.so.6 .
COPY --from=phy-sim-build /lib64/libXpm.so.4 .
COPY --from=phy-sim-build /lib64/libxcb.so.1 .
COPY --from=phy-sim-build /lib64/libXau.so.6 .
COPY --from=phy-sim-build /lib64/libforms.so.2 .
COPY --from=phy-sim-build /lib64/libblas.so.3 .
COPY --from=phy-sim-build /lib64/liblapack.so.3 .
COPY --from=phy-sim-build /lib64/libexslt.so.0 .
COPY --from=phy-sim-build /lib64/libxslt.so.1 .
COPY --from=phy-sim-build /oai-ran/cmake_targets/phy_simulators/build/libdfts.so .
COPY --from=phy-sim-build /oai-ran/cmake_targets/phy_simulators/build/libSIMU.so .
COPY --from=phy-sim-build /oai-ran/cmake_targets/phy_simulators/build/libldpc.so .
COPY --from=phy-sim-build /oai-ran/cmake_targets/phy_simulators/build/libldpc_orig.so .
COPY --from=phy-sim-build \
/oai-ran/targets/bin/libcoding.so \
/lib64/liblapacke.so.3 \
/lib64/libX11.so.6 \
/lib64/libXpm.so.4 \
/lib64/libxcb.so.1 \
/lib64/libXau.so.6 \
/lib64/libforms.so.2 \
/lib64/libblas.so.3 \
/lib64/liblapack.so.3 \
/lib64/libexslt.so.0 \
/lib64/libxslt.so.1 \
/oai-ran/cmake_targets/phy_simulators/build/libdfts.so \
/oai-ran/cmake_targets/phy_simulators/build/libSIMU.so \
/oai-ran/cmake_targets/phy_simulators/build/libldpc.so \
/oai-ran/cmake_targets/phy_simulators/build/libldpc_orig.so \
./
RUN ldconfig
#debug
#RUN ldd /opt/oai-physim/targets/bin/dlsim.Rel15
#RUN ldd /opt/oai-physim/targets/bin/nr_dlsim.Rel15
#RUN ldd /opt/oai-physim/targets/bin/nr_prachsim.Rel15
#RUN ldd /opt/oai-physim/targets/bin/nr_ulschsim.Rel15
#RUN ldd /opt/oai-physim/targets/bin/polartest.Rel15
#RUN ldd /opt/oai-physim/targets/bin/ulsim.Rel15
#RUN ldd /opt/oai-physim/targets/bin/ldpctest.Rel15
#RUN ldd /opt/oai-physim/targets/bin/nr_dlschsim.Rel15
#RUN ldd /opt/oai-physim/targets/bin/nr_pbchsim.Rel15
#RUN ldd /opt/oai-physim/targets/bin/nr_pucchsim.Rel15
#RUN ldd /opt/oai-physim/targets/bin/nr_ulsim.Rel15
#RUN ldd /opt/oai-physim/targets/bin/smallblocktest.Rel15
# Copy some executables
WORKDIR /usr/bin/
COPY --from=phy-sim-build /usr/bin/killall .
COPY --from=phy-sim-build /usr/bin/xmlstarlet .
COPY --from=phy-sim-build /usr/bin/svn .
COPY --from=phy-sim-build \
/usr/bin/killall \
/usr/bin/xmlstarlet \
/usr/bin/svn \
./
# Copy the relevant configuration files for phySim
WORKDIR /opt/oai-physim/
COPY --from=phy-sim-build /oai-ran/cmake_targets/autotests/run_exec_autotests.bash /opt/oai-physim/cmake_targets/autotests/
COPY --from=phy-sim-build /oai-ran/cmake_targets/autotests/test_case_list.xml /opt/oai-physim/cmake_targets/autotests/
COPY --from=phy-sim-build /oai-ran/cmake_targets/autotests/tools/free_mem.bash /opt/oai-physim/cmake_targets/autotests/tools/
COPY --from=phy-sim-build /oai-ran/cmake_targets/tools/build_helper /opt/oai-physim/cmake_targets/tools/
COPY --from=phy-sim-build /oai-ran/cmake_targets/tools/test_helper /opt/oai-physim/cmake_targets/tools/
COPY --from=phy-sim-build \
/oai-ran/cmake_targets/autotests/run_exec_autotests.bash \
/oai-ran/cmake_targets/autotests/test_case_list.xml \
/opt/oai-physim/cmake_targets/autotests/
COPY --from=phy-sim-build \
/oai-ran/cmake_targets/autotests/tools/free_mem.bash \
/oai-ran/cmake_targets/tools/build_helper \
/oai-ran/cmake_targets/tools/test_helper \
/opt/oai-physim/cmake_targets/tools/
#CMD ["sleep", "infinity"]