Commit 42e2de68 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-ausf!18
parents 5adbaedb e8de1b18
# RELEASE NOTES : # # RELEASE NOTES : #
## v1.3.0 -- December 2021 ## ## v1.3.0 -- January 2021 ##
* HTTP2 Support * HTTP2 Support
* Docker optimization
## v1.2.1 -- October 2021 ## ## v1.2.1 -- October 2021 ##
......
...@@ -36,7 +36,8 @@ RUN cp -Rf /openair-ausf-ext-ref /openair-ausf/build/ext ...@@ -36,7 +36,8 @@ RUN cp -Rf /openair-ausf-ext-ref /openair-ausf/build/ext
# Building AUSF # Building AUSF
WORKDIR /openair-ausf/build/scripts WORKDIR /openair-ausf/build/scripts
RUN ./build_ausf --clean --Verbose --build-type Release --jobs RUN ./build_ausf --clean --Verbose --build-type Release --jobs && \
mv /openair-ausf/build/ausf/build/ausf /openair-ausf/build/ausf/build/oai_ausf
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# TARGET IMAGE # TARGET IMAGE
...@@ -55,21 +56,28 @@ RUN apt-get update && \ ...@@ -55,21 +56,28 @@ RUN apt-get update && \
tshark \ tshark \
perl \ perl \
libasan4 \ libasan4 \
libnettle6 \
libnghttp2-14 \ libnghttp2-14 \
libhogweed4 \ libhogweed4 \
libldap-2.4-2 \
librtmp1 \
libpsl5 \
libconfig++9v5 \ libconfig++9v5 \
libcurl4-gnutls-dev \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Copying executable and generated libraries # Copying executable and generated libraries
WORKDIR /openair-ausf/bin WORKDIR /openair-ausf/bin
COPY --from=oai-ausf-builder /openair-ausf/build/ausf/build/ausf oai_ausf COPY --from=oai-ausf-builder \
COPY --from=oai-ausf-builder /openair-ausf/scripts/entrypoint.sh . /openair-ausf/build/ausf/build/oai_ausf \
/openair-ausf/scripts/entrypoint.sh \
./
COPY --from=oai-ausf-builder /usr/local/lib/libpistache.so /usr/local/lib/ COPY --from=oai-ausf-builder \
COPY --from=oai-ausf-builder /usr/lib/x86_64-linux-gnu/libnettle.so.6 /usr/local/lib/ /usr/local/lib/libpistache.so \
COPY --from=oai-ausf-builder /usr/lib/libboost_system.so.1.67.0 /usr/local/lib/ /usr/lib/libboost_system.so.1.67.0 \
COPY --from=oai-ausf-builder /usr/local/lib/libnghttp2_asio.so.1 /usr/local/lib/ /usr/local/lib/libnghttp2_asio.so.1 \
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 \
/usr/local/lib/
RUN ldconfig RUN ldconfig
......
...@@ -64,9 +64,9 @@ COPY . /openair-ausf ...@@ -64,9 +64,9 @@ COPY . /openair-ausf
# Installing and Building AUSF # Installing and Building AUSF
WORKDIR /openair-ausf/build/scripts WORKDIR /openair-ausf/build/scripts
RUN ./build_ausf --install-deps --force RUN ./build_ausf --install-deps --force
RUN ./build_ausf --clean --Verbose --build-type Release --jobs RUN ./build_ausf --clean --Verbose --build-type Release --jobs && \
ldd /openair-ausf/build/ausf/build/ausf && \
RUN ldd /openair-ausf/build/ausf/build/ausf mv /openair-ausf/build/ausf/build/ausf /openair-ausf/build/ausf/build/oai_ausf
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# TARGET IMAGE # TARGET IMAGE
...@@ -92,20 +92,24 @@ RUN yum update -y && \ ...@@ -92,20 +92,24 @@ RUN yum update -y && \
# Copying executable and generated libraries # Copying executable and generated libraries
WORKDIR /openair-ausf/bin WORKDIR /openair-ausf/bin
COPY --from=oai-ausf-builder /openair-ausf/build/ausf/build/ausf oai_ausf COPY --from=oai-ausf-builder \
COPY --from=oai-ausf-builder /openair-ausf/scripts/entrypoint.sh . /openair-ausf/build/ausf/build/oai_ausf \
/openair-ausf/scripts/entrypoint.sh \
./
WORKDIR /usr/local/lib64 WORKDIR /usr/local/lib64
COPY --from=oai-ausf-builder /usr/local/lib64/libpistache.so.0 . COPY --from=oai-ausf-builder \
COPY --from=oai-ausf-builder /lib64/libboost_system.so.1.66.0 . /usr/local/lib64/libpistache.so.0 \
COPY --from=oai-ausf-builder /lib64/libboost_thread.so.1.66.0 . /lib64/libboost_system.so.1.66.0 \
COPY --from=oai-ausf-builder /lib64/libboost_date_time.so.1.66.0 . /lib64/libboost_thread.so.1.66.0 \
COPY --from=oai-ausf-builder /lib64/libconfig++.so.9 . /lib64/libboost_date_time.so.1.66.0 \
COPY --from=oai-ausf-builder /lib64/libnghttp2.so.14 . /lib64/libconfig++.so.9 \
COPY --from=oai-ausf-builder /usr/local/lib/libnghttp2_asio.so.1 /usr/lib64/ /lib64/libnghttp2.so.14 \
/usr/local/lib/libnghttp2_asio.so.1 \
RUN ldconfig -v ./
RUN ldd /openair-ausf/bin/oai_ausf
RUN ldconfig -v && \
ldd /openair-ausf/bin/oai_ausf
WORKDIR /openair-ausf/etc WORKDIR /openair-ausf/etc
COPY --from=oai-ausf-builder /openair-ausf/etc/ausf.conf . COPY --from=oai-ausf-builder /openair-ausf/etc/ausf.conf .
......
...@@ -34,10 +34,12 @@ ARG NEEDED_GIT_PROXY ...@@ -34,10 +34,12 @@ ARG NEEDED_GIT_PROXY
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \ RUN apt-get update && \
psmisc \ DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
software-properties-common \ DEBIAN_FRONTEND=noninteractive apt-get install --yes \
git \ psmisc \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Some GIT configuration command quite useful # Some GIT configuration command quite useful
...@@ -52,7 +54,8 @@ COPY . /openair-ausf ...@@ -52,7 +54,8 @@ COPY . /openair-ausf
# Installing and Building AUSF # Installing and Building AUSF
WORKDIR /openair-ausf/build/scripts WORKDIR /openair-ausf/build/scripts
RUN ./build_ausf --install-deps --force RUN ./build_ausf --install-deps --force
RUN ./build_ausf --clean --Verbose --build-type Release --jobs RUN ./build_ausf --clean --Verbose --build-type Release --jobs && \
mv /openair-ausf/build/ausf/build/ausf /openair-ausf/build/ausf/build/oai_ausf
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# TARGET IMAGE # TARGET IMAGE
...@@ -74,18 +77,25 @@ RUN apt-get update && \ ...@@ -74,18 +77,25 @@ RUN apt-get update && \
libnettle6 \ libnettle6 \
libnghttp2-14 \ libnghttp2-14 \
libhogweed4 \ libhogweed4 \
libldap-2.4-2 \
librtmp1 \
libpsl5 \
libconfig++9v5 \ libconfig++9v5 \
libcurl4-gnutls-dev \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Copying executable and generated libraries # Copying executable and generated libraries
WORKDIR /openair-ausf/bin WORKDIR /openair-ausf/bin
COPY --from=oai-ausf-builder /openair-ausf/build/ausf/build/ausf oai_ausf COPY --from=oai-ausf-builder \
COPY --from=oai-ausf-builder /openair-ausf/scripts/entrypoint.sh . /openair-ausf/build/ausf/build/oai_ausf \
/openair-ausf/scripts/entrypoint.sh \
./
COPY --from=oai-ausf-builder /usr/local/lib/libpistache.so /usr/local/lib/ COPY --from=oai-ausf-builder \
COPY --from=oai-ausf-builder /usr/lib/libboost_system.so.1.67.0 /usr/local/lib/ /usr/local/lib/libpistache.so \
COPY --from=oai-ausf-builder /usr/local/lib/libnghttp2_asio.so.1 /usr/local/lib/ /usr/lib/libboost_system.so.1.67.0 \
/usr/local/lib/libnghttp2_asio.so.1 \
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 \
/usr/local/lib/
RUN ldconfig RUN ldconfig
......
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