Skip to content

Commit

Permalink
Merge pull request #742 from weli-l/dev/kmesh_manage
Browse files Browse the repository at this point in the history
modify dockerfile
  • Loading branch information
kmesh-bot authored Aug 16, 2024
2 parents 24209e8 + f10e507 commit c45453b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/release-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ jobs:

- name: Checkout code
uses: actions/checkout@v3

- name: Build
run: |
./kmesh_compile.sh
- name: Build and push by digest
- name: Push by digest
id: build
uses: docker/build-push-action@v6
with:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ build:
./kmesh_compile.sh

.PHONY: docker
docker:
docker: build
docker build -f build/docker/dockerfile -t $(HUB)/$(TARGET):$(TAG) .

docker.push: docker
Expand Down
33 changes: 14 additions & 19 deletions build/docker/dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
FROM ghcr.io/kmesh-net/kmesh-build:latest AS builder
COPY . /kmesh
WORKDIR /kmesh
RUN ./build.sh && ./build.sh -i
# Copy the kmesh.ko to /kmesh
RUN if [ -f /lib/modules/kmesh/kmesh.ko ]; then cp /lib/modules/kmesh/kmesh.ko /kmesh; fi

# Usage:
# docker run -itd --privileged=true -v /etc/cni/net.d:/etc/cni/net.d -v /opt/cni/bin:/opt/cni/bin -v /mnt:/mnt -v /sys/fs/bpf:/sys/fs/bpf -v /lib/modules:/lib/modules --name kmesh kmesh:latest
#
FROM openeuler/openeuler:23.09

WORKDIR /kmesh

RUN \
--mount=type=cache,target=/var/cache/dnf \
yum install -y kmod util-linux iptables && \
mkdir -p /usr/share/oncn-mda && \
mkdir -p /etc/oncn-mda
COPY --from=builder /usr/lib64/libbpf.so* /usr/lib64/
COPY --from=builder /usr/lib64/libprotobuf-c.so* /usr/lib64/
COPY --from=builder /usr/lib64/libkmesh_api_v2_c.so /usr/lib64/
COPY --from=builder /usr/lib64/libkmesh_deserial.so /usr/lib64/
COPY --from=builder /usr/lib64/libboundscheck.so /usr/lib64/
COPY --from=builder /kmesh/*.ko /kmesh
COPY --from=builder /kmesh/oncn-mda/build/ebpf_src/CMakeFiles/sock_redirect.dir/sock_redirect.c.o /usr/share/oncn-mda/
COPY --from=builder /kmesh/oncn-mda/etc/oncn-mda.conf /usr/share/oncn-mda/
COPY --from=builder /usr/bin/kmesh-daemon /usr/bin/
COPY --from=builder /usr/bin/kmesh-cni /usr/bin/
COPY --from=builder /usr/bin/mdacore /usr/bin/
COPY build/docker/start_kmesh.sh /kmesh

COPY out/*so* /usr/lib64/
COPY out/*.o /usr/share/oncn-mda/
COPY out/oncn-mda.conf /etc/oncn-mda/
COPY out/kmesh-daemon /usr/bin/
COPY out/kmesh-cni /usr/bin/
COPY out/mdacore /usr/bin/
COPY build/docker/start_kmesh.sh /kmesh
COPY out/ko /kmesh

0 comments on commit c45453b

Please sign in to comment.