Commit 1156e160 authored by Raphael Defosseux's avatar Raphael Defosseux

feat(docker): optimization on the number of layers

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 50e32bdc
......@@ -30,13 +30,15 @@
#---------------------------------------------------------------------
FROM oai-amf-base:latest as oai-amf-builder
# Copying source code
WORKDIR /openair-amf/
COPY . /openair-amf
RUN cp -Rf /openair-amf-ext-ref /openair-amf/build/ext
# Building AMF
WORKDIR /openair-amf/build/scripts
RUN ./build_amf --clean --Verbose --build-type Release --jobs
RUN ./build_amf --clean --Verbose --build-type Release --jobs && \
mv /openair-amf/build/amf/build/amf /openair-amf/build/amf/build/oai_amf
#---------------------------------------------------------------------
# TARGET IMAGE
......@@ -63,22 +65,28 @@ RUN apt-get update && \
# Copying executable and generated libraries
WORKDIR /openair-amf/bin
COPY --from=oai-amf-builder /openair-amf/build/amf/build/amf oai_amf
COPY --from=oai-amf-builder /openair-amf/scripts/entrypoint.sh entrypoint.sh
COPY --from=oai-amf-builder \
/openair-amf/build/amf/build/oai_amf \
/openair-amf/scripts/entrypoint.sh \
./
WORKDIR /usr/lib/x86_64-linux-gnu
COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 .
COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 .
COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 .
COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/librtmp.so.1 .
COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/libpsl.so.5 .
COPY --from=oai-amf-builder \
/usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 \
/usr/lib/x86_64-linux-gnu/libsqlite3.so.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 \
./
WORKDIR /usr/local/lib
COPY --from=oai-amf-builder /usr/local/lib/libnghttp2_asio.so.1 .
COPY --from=oai-amf-builder /usr/lib/libboost_system.so.1.67.0 .
COPY --from=oai-amf-builder /usr/lib/libboost_thread.so.1.67.0 .
COPY --from=oai-amf-builder /usr/lib/libboost_chrono.so.1.67.0 .
COPY --from=oai-amf-builder /usr/local/lib/libpistache.so .
COPY --from=oai-amf-builder \
/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/local/lib/libpistache.so \
./
RUN ldconfig
......
......@@ -69,7 +69,8 @@ RUN ./build_amf --install-deps --force
# Building AMF
WORKDIR /openair-amf/build/scripts
RUN ./build_amf --clean --Verbose --build-type Release --jobs
RUN ./build_amf --clean --Verbose --build-type Release --jobs && \
mv /openair-amf/build/amf/build/amf /openair-amf/build/amf/build/oai_amf
#---------------------------------------------------------------------
# TARGET IMAGE
......@@ -89,28 +90,33 @@ RUN yum update -y && \
# Copying executable and generated libraries
WORKDIR /openair-amf/bin
COPY --from=oai-amf-builder /openair-amf/build/amf/build/amf oai_amf
COPY --from=oai-amf-builder /usr/lib64/libconfig++.so.9 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libboost_system.so.1.66.0 /usr/lib64/
COPY --from=oai-amf-builder /usr/local/lib64/libpistache.so.0 /usr/lib64/
COPY --from=oai-amf-builder /usr/local/lib/libnghttp2_asio.so /usr/lib64/
COPY --from=oai-amf-builder /usr/local/lib/libnghttp2_asio.so.1 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/mysql/libmysqlclient.so.21 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libsctp.so.1 /usr/lib64/
COPY --from=oai-amf-builder /usr/local/lib64/libcpprest.so.2.10 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libboost_random.so.1.66.0 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libboost_thread.so.1.66.0 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libboost_filesystem.so.1.66.0 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libboost_chrono.so.1.66.0 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libboost_atomic.so.1.66.0 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libboost_date_time.so.1.66.0 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libboost_regex.so.1.66.0 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libicudata.so.60 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libicui18n.so.60 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libicuuc.so.60 /usr/lib64/
COPY --from=oai-amf-builder /openair-amf/scripts/entrypoint.sh entrypoint.sh
COPY --from=oai-amf-builder \
/openair-amf/build/amf/build/oai_amf \
/openair-amf/scripts/entrypoint.sh \
./
COPY --from=oai-amf-builder \
/usr/lib64/libconfig++.so.9 \
/usr/lib64/libboost_system.so.1.66.0 \
/usr/local/lib64/libpistache.so.0 \
/usr/local/lib/libnghttp2_asio.so \
/usr/local/lib/libnghttp2_asio.so.1 \
/usr/lib64/mysql/libmysqlclient.so.21 \
/usr/lib64/libsctp.so.1 \
/usr/local/lib64/libcpprest.so.2.10 \
/usr/lib64/libboost_random.so.1.66.0 \
/usr/lib64/libboost_thread.so.1.66.0 \
/usr/lib64/libboost_filesystem.so.1.66.0 \
/usr/lib64/libboost_chrono.so.1.66.0 \
/usr/lib64/libboost_atomic.so.1.66.0 \
/usr/lib64/libboost_date_time.so.1.66.0 \
/usr/lib64/libboost_regex.so.1.66.0 \
/usr/lib64/libicudata.so.60 \
/usr/lib64/libicui18n.so.60 \
/usr/lib64/libicuuc.so.60 \
/usr/lib64/
RUN ldconfig
# Copying template configuration files
WORKDIR /openair-amf/etc
......
......@@ -48,6 +48,7 @@ RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.pr
git config --global https.postBuffer 123289600 && \
git config --global http.sslverify false
# Copying source code
WORKDIR /openair-amf/
COPY . /openair-amf
......@@ -57,7 +58,8 @@ RUN ./build_amf --install-deps --force
# Building AMF
WORKDIR /openair-amf/build/scripts
RUN ./build_amf --clean --Verbose --build-type Release --jobs
RUN ./build_amf --clean --Verbose --build-type Release --jobs && \
mv /openair-amf/build/amf/build/amf /openair-amf/build/amf/build/oai_amf
#---------------------------------------------------------------------
# TARGET IMAGE
......@@ -84,22 +86,28 @@ RUN apt-get update && \
# Copying executable and generated libraries
WORKDIR /openair-amf/bin
COPY --from=oai-amf-builder /openair-amf/build/amf/build/amf oai_amf
COPY --from=oai-amf-builder /openair-amf/scripts/entrypoint.sh entrypoint.sh
COPY --from=oai-amf-builder \
/openair-amf/build/amf/build/oai_amf \
/openair-amf/scripts/entrypoint.sh \
./
WORKDIR /usr/lib/x86_64-linux-gnu
COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 .
COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 .
COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 .
COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/librtmp.so.1 .
COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/libpsl.so.5 .
COPY --from=oai-amf-builder \
/usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 \
/usr/lib/x86_64-linux-gnu/libsqlite3.so.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 \
./
WORKDIR /usr/local/lib
COPY --from=oai-amf-builder /usr/local/lib/libnghttp2_asio.so.1 .
COPY --from=oai-amf-builder /usr/lib/libboost_system.so.1.67.0 .
COPY --from=oai-amf-builder /usr/lib/libboost_thread.so.1.67.0 .
COPY --from=oai-amf-builder /usr/lib/libboost_chrono.so.1.67.0 .
COPY --from=oai-amf-builder /usr/local/lib/libpistache.so .
COPY --from=oai-amf-builder \
/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/local/lib/libpistache.so \
./
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