From dd0017ff0ba9bbd6766bef0868252a8975f48052 Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Tue, 19 Mar 2024 13:14:27 +0900 Subject: [PATCH] gh-482 Docker image size reduction --- Dockerfile | 34 +++++++++++++++++++++++++++++----- cicd/httpsep/validation.sh | 2 ++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 373d5753e..ba69a6b82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,5 @@ -# Download base image ubuntu 20.04 -FROM ubuntu:20.04 - -# LABEL about the loxilb image -LABEL description="loxilb official docker image" +# Download base image ubuntu 20.04 for build +FROM ubuntu:20.04 as build # Disable Prompt During Packages Installation ARG DEBIAN_FRONTEND=noninteractive @@ -71,6 +68,33 @@ RUN mkdir -p /opt/loxilb && \ # COPY ./llb_ebpf_main.o.rep* /opt/loxilb/llb_ebpf_main.o # COPY ./llb_xdp_main.o.rep* /opt/loxilb/llb_xdp_main.o +FROM ubuntu:20.04 + +# LABEL about the loxilb image +LABEL description="loxilb official docker image" + +# Disable Prompt During Packages Installation +ARG DEBIAN_FRONTEND=noninteractive + +# Env variables +ENV PATH="${PATH}:/usr/local/go/bin" +ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib64/" + +RUN apt-get update && apt-get install -y --no-install-recommends sudo libbsd-dev iproute2 tcpdump bridge-utils net-tools && \ + rm -rf /var/lib/apt/lists/* && apt clean + +COPY --from=build /usr/lib64/libbpf* /usr/lib64/ +COPY --from=build /usr/local/go/bin /usr/local/go/bin +COPY --from=build /usr/local/sbin/mkllb_bpffs /usr/local/sbin/mkllb_bpffs +COPY --from=build /usr/local/sbin/loxilb_dp_debug /usr/local/sbin/loxilb_dp_debug +COPY --from=build /usr/local/sbin/loxicmd /usr/local/sbin/loxicmd +COPY --from=build /opt/loxilb /opt/loxilb +COPY --from=build /root/loxilb-io/loxilb/loxilb /root/loxilb-io/loxilb/loxilb +COPY --from=build /usr/local/sbin/ntc /usr/local/sbin/ntc +COPY --from=build /usr/local/sbin/bpftool /usr/local/sbin/bpftool +COPY --from=build /usr/sbin/gobgp* /usr/sbin/ +COPY --from=build /root/.bashrc /root/.bashrc + ENTRYPOINT ["/root/loxilb-io/loxilb/loxilb"] # Expose Ports diff --git a/cicd/httpsep/validation.sh b/cicd/httpsep/validation.sh index c3a493295..df8279c4e 100755 --- a/cicd/httpsep/validation.sh +++ b/cicd/httpsep/validation.sh @@ -2,6 +2,8 @@ source ../common.sh echo SCENARIO-httpsep +$dexec llb1 bash -c "apt update && apt install -y curl" + servArr=( "server1" "server2" "server3" ) ep=( "31.31.31.1" "32.32.32.1" "33.33.33.1" ) code=0