Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: gh-482 Docker image size reduction #595

Merged
merged 3 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading