Skip to content

Commit

Permalink
support: use local compiled files to build docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
ianchen0119 committed May 8, 2023
1 parent 042ba71 commit c86ff4a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ RUN rm -fr /root/loxilb-io/loxilb/.git
RUN rm -fr /root/loxilb-io/loxilb/.github
RUN mkdir -p /root/loxilb-io/loxilb/
RUN cp /usr/local/sbin/loxilb /root/loxilb-io/loxilb/loxilb
#RUN /usr/local/sbin/mkllb_bpffs

#RUN cd /root/loxilb-io/loxilb/ && make test

# Optional files, only apply when files exist
COPY ./loxilb.rep* /root/loxilb-io/loxilb/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

ENTRYPOINT ["/root/loxilb-io/loxilb/loxilb"]

# Expose Ports
Expand Down
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,20 @@ docker-cp-ebpf: build
docker cp /opt/loxilb/llb_ebpf_main.o $(loxilbid):/opt/loxilb/llb_ebpf_main.o
docker cp /opt/loxilb/llb_xdp_main.o $(loxilbid):/opt/loxilb/llb_xdp_main.o

docker:
docker-rp: build
cp loxilb ./loxilb.rep
cp /opt/loxilb/llb_ebpf_main.o ./llb_ebpf_main.o.rep
cp /opt/loxilb/llb_xdp_main.o ./llb_xdp_main.o.rep
$(MAKE) docker
rm ./llb_ebpf_main.o.rep ./llb_xdp_main.o.rep ./loxilb.rep

docker-rp-ebpf: build
cp /opt/loxilb/llb_ebpf_main.o ./llb_ebpf_main.o.rep
cp /opt/loxilb/llb_xdp_main.o ./llb_xdp_main.o.rep
$(MAKE) docker
rm ./llb_ebpf_main.o.rep ./llb_xdp_main.o.rep

docker:
docker build -t ghcr.io/loxilb-io/loxilb:latest .

docker-arm64:
Expand Down

0 comments on commit c86ff4a

Please sign in to comment.