Skip to content

Commit

Permalink
Merge pull request #595 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
PR: gh-482 Docker image size reduction
  • Loading branch information
UltraInstinct14 authored Mar 19, 2024
2 parents 7000c77 + 8e60502 commit 304d4be
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
34 changes: 29 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions cicd/httpsep/validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 304d4be

Please sign in to comment.