Commit 553c7e20 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'docker-opt' into 'develop'

docker(build): optimization on the number of layers

See merge request oai/cn5g/oai-cn5g-smf!116
parents db43eb66 df610add
......@@ -36,7 +36,9 @@ RUN cp -Rf /openair-smf-ext-ref /openair-smf/build/ext
# Building SMF
WORKDIR /openair-smf/build/scripts
RUN ./build_smf --clean --Verbose --build-type Release --jobs
RUN ./build_smf --clean --Verbose --build-type Release --jobs && \
ldd /openair-smf/build/smf/build/smf && \
mv /openair-smf/build/smf/build/smf /openair-smf/build/smf/build/oai_smf
#---------------------------------------------------------------------
# TARGET IMAGE
......@@ -64,20 +66,25 @@ RUN apt-get update && \
# Copying executable and generated libraries
WORKDIR /openair-smf/bin
COPY --from=oai-smf-builder /openair-smf/build/smf/build/smf oai_smf
COPY --from=oai-smf-builder /openair-smf/scripts/entrypoint.sh .
COPY --from=oai-smf-builder \
/openair-smf/build/smf/build/oai_smf \
/openair-smf/scripts/entrypoint.sh \
./
WORKDIR /usr/local/lib/
COPY --from=oai-smf-builder /usr/local/lib/libpistache.so .
COPY --from=oai-smf-builder /usr/local/lib/libnghttp2_asio.so.1 .
COPY --from=oai-smf-builder /usr/lib/libboost_system.so.1.67.0 .
COPY --from=oai-smf-builder /usr/lib/libboost_thread.so.1.67.0 .
COPY --from=oai-smf-builder /usr/lib/libboost_chrono.so.1.67.0 .
COPY --from=oai-smf-builder /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 .
COPY --from=oai-smf-builder /usr/lib/x86_64-linux-gnu/librtmp.so.1 .
COPY --from=oai-smf-builder /usr/lib/x86_64-linux-gnu/libpsl.so.5 .
COPY --from=oai-smf-builder /openair-smf/build/smf/build/nas/libNAS.so .
RUN ldconfig
COPY --from=oai-smf-builder \
/usr/local/lib/libpistache.so \
/usr/local/lib/libnghttp2_asio.so.1 \
/usr/lib/libboost_system.so.1.67.0 \
/usr/lib/libboost_thread.so.1.67.0 \
/usr/lib/libboost_chrono.so.1.67.0 \
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 \
/usr/lib/x86_64-linux-gnu/librtmp.so.1 \
/usr/lib/x86_64-linux-gnu/libpsl.so.5 \
/openair-smf/build/smf/build/nas/libNAS.so \
./
RUN ldconfig && \
ldd /openair-smf/bin/oai_smf
# Copying template configuration files
# The configuration folder will be flat
......
......@@ -48,8 +48,8 @@ RUN rm -f /etc/rhsm-host && \
# Some GIT configuration command quite useful
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
RUN git config --global https.postBuffer 123289600
RUN git config --global http.sslverify false
RUN git config --global https.postBuffer 123289600 && \
git config --global http.sslverify false
# Copying source code
WORKDIR /openair-smf
......@@ -58,15 +58,10 @@ COPY . /openair-smf
# Installing and Building SMF
WORKDIR /openair-smf/build/scripts
RUN ./build_smf --install-deps --force
RUN ./build_smf --clean --Verbose --build-type Release --jobs
RUN rm /etc/pki/entitlement/*pem
# debug
#WORKDIR /openair-smf
#RUN ldconfig -v && ldd /usr/local/bin/smf
#RUN ls -ls /usr/local/lib/
RUN ./build_smf --clean --Verbose --build-type Release --jobs && \
ldd /openair-smf/build/smf/build/smf && \
mv /openair-smf/build/smf/build/smf /openair-smf/build/smf/build/oai_smf && \
rm /etc/pki/entitlement/*pem
#---------------------------------------------------------------------
# TARGET IMAGE
......@@ -77,6 +72,7 @@ ENV TZ=Europe/Paris
RUN yum update -y && \
yum install -y --enablerepo="ubi-8-codeready-builder" \
psmisc \
tzdata \
procps-ng \
net-tools \
libevent && \
......@@ -84,25 +80,28 @@ RUN yum update -y && \
# Copying executable and generated libraries
WORKDIR /openair-smf/bin
COPY --from=oai-smf-builder /openair-smf/build/smf/build/smf oai_smf
COPY --from=oai-smf-builder /usr/local/lib64/libpistache.so.0 /usr/lib64/
COPY --from=oai-smf-builder /usr/local/lib/libnghttp2_asio.so /usr/lib64/
COPY --from=oai-smf-builder /usr/lib64/libgflags.so.2.1 /usr/lib64/
COPY --from=oai-smf-builder /usr/lib64/libglog.so.0 /usr/lib64/
COPY --from=oai-smf-builder /usr/lib64/libdouble-conversion.so.1 /usr/lib64/
COPY --from=oai-smf-builder /usr/lib64/libconfig++.so.9 /usr/lib64/
COPY --from=oai-smf-builder /usr/lib64/libboost_system.so.1.66.0 /usr/lib64/
COPY --from=oai-smf-builder /usr/lib64/libboost_thread.so.1.66.0 /usr/lib64/
COPY --from=oai-smf-builder /usr/lib64/libboost_chrono.so.1.66.0 /usr/lib64/
COPY --from=oai-smf-builder /usr/local/lib/libnghttp2_asio.so.1 /usr/lib64/
COPY --from=oai-smf-builder /usr/lib64/libasan.so.5 /usr/lib64/
COPY --from=oai-smf-builder /openair-smf/build/smf/build/nas/libNAS.so /usr/lib64/
COPY --from=oai-smf-builder /openair-smf/scripts/entrypoint.sh entrypoint.sh
# debug
#RUN ldconfig -v
#RUN ldd oai_smf
COPY --from=oai-smf-builder \
/openair-smf/build/smf/build/oai_smf \
/openair-smf/scripts/entrypoint.sh \
./
COPY --from=oai-smf-builder \
/usr/local/lib64/libpistache.so.0 \
/usr/local/lib/libnghttp2_asio.so \
/usr/lib64/libgflags.so.2.1 \
/usr/lib64/libglog.so.0 \
/usr/lib64/libdouble-conversion.so.1 \
/usr/lib64/libconfig++.so.9 \
/usr/lib64/libboost_system.so.1.66.0 \
/usr/lib64/libboost_thread.so.1.66.0 \
/usr/lib64/libboost_chrono.so.1.66.0 \
/usr/local/lib/libnghttp2_asio.so.1 \
/usr/lib64/libasan.so.5 \
/openair-smf/build/smf/build/nas/libNAS.so \
/usr/lib64/
RUN ldconfig -v && \
ldd /openair-smf/bin/oai_smf
# Copying template configuration files
# The configuration folder will be flat
......@@ -115,5 +114,4 @@ WORKDIR /openair-smf
EXPOSE 80/tcp 9090/tcp 8805/udp
ENTRYPOINT ["/openair-smf/bin/entrypoint.sh"]
CMD ["/openair-smf/bin/oai_smf", "-c", "/openair-smf/etc/smf.conf", "-o"]
......@@ -55,7 +55,9 @@ COPY . /openair-smf
# Installing and Building SMF
WORKDIR /openair-smf/build/scripts
RUN ./build_smf --install-deps --force
RUN ./build_smf --clean --Verbose --build-type Release --jobs
RUN ./build_smf --clean --Verbose --build-type Release --jobs && \
ldd /openair-smf/build/smf/build/smf && \
mv /openair-smf/build/smf/build/smf /openair-smf/build/smf/build/oai_smf
#---------------------------------------------------------------------
# TARGET IMAGE
......@@ -83,20 +85,25 @@ RUN apt-get update && \
# Copying executable and generated libraries
WORKDIR /openair-smf/bin
COPY --from=oai-smf-builder /openair-smf/build/smf/build/smf oai_smf
COPY --from=oai-smf-builder /openair-smf/scripts/entrypoint.sh .
COPY --from=oai-smf-builder \
/openair-smf/build/smf/build/oai_smf \
/openair-smf/scripts/entrypoint.sh \
./
WORKDIR /usr/local/lib/
COPY --from=oai-smf-builder /usr/local/lib/libpistache.so .
COPY --from=oai-smf-builder /usr/local/lib/libnghttp2_asio.so.1 .
COPY --from=oai-smf-builder /usr/lib/libboost_system.so.1.67.0 .
COPY --from=oai-smf-builder /usr/lib/libboost_thread.so.1.67.0 .
COPY --from=oai-smf-builder /usr/lib/libboost_chrono.so.1.67.0 .
COPY --from=oai-smf-builder /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 .
COPY --from=oai-smf-builder /usr/lib/x86_64-linux-gnu/librtmp.so.1 .
COPY --from=oai-smf-builder /usr/lib/x86_64-linux-gnu/libpsl.so.5 .
COPY --from=oai-smf-builder /openair-smf/build/smf/build/nas/libNAS.so .
RUN ldconfig
COPY --from=oai-smf-builder \
/usr/local/lib/libpistache.so \
/usr/local/lib/libnghttp2_asio.so.1 \
/usr/lib/libboost_system.so.1.67.0 \
/usr/lib/libboost_thread.so.1.67.0 \
/usr/lib/libboost_chrono.so.1.67.0 \
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 \
/usr/lib/x86_64-linux-gnu/librtmp.so.1 \
/usr/lib/x86_64-linux-gnu/libpsl.so.5 \
/openair-smf/build/smf/build/nas/libNAS.so \
./
RUN ldconfig && \
ldd /openair-smf/bin/oai_smf
# Copying template configuration files
# The configuration folder will be flat
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment