update build bpf image

This commit is contained in:
zhouchaowen
2023-09-14 22:49:19 +08:00
parent 5b17b439d2
commit 3009afc292
4 changed files with 10 additions and 14 deletions

View File

@@ -1,15 +1,8 @@
FROM ebpf-build:v22.04-llvm-14 as builder
FROM ghcr.io/cilium/ebpf-builder:1694533004 as builder
WORKDIR /prism
COPY . .
RUN make gen
FROM golang:1.18.6 as compiler
WORKDIR /app
COPY --from=builder /prism .
RUN go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct && go mod tidy
RUN go build -ldflags "-s -w" -o prism .
RUN make build
FROM ubuntu:22.04
ARG DIR_NAME
@@ -17,5 +10,5 @@ WORKDIR /
RUN mkdir web
COPY --from=builder /prism/web /web
COPY --from=compiler /app/prism .
COPY --from=builder /prism/prism .
RUN chmod +x prism

View File

@@ -14,6 +14,9 @@ IMAGE ?= $(NAME):$(VERSION)
format:
find . -type f -name "*.c" | xargs clang-format -i
env:
go env -w GOPROXY=https://goproxy.cn,direct && go install github.com/cilium/ebpf/cmd/bpf2go@latest
# $BPF_CLANG is used in go:generate invocations.
gen: export BPF_CLANG := $(CLANG)
gen: export BPF_CFLAGS := $(CFLAGS)
@@ -28,8 +31,8 @@ ps:
pl:
scp -r root@10.2.0.105:/root/prism/* .
build:
make gen && export GO111MODULE=on && go build -ldflags "-s -w" -o prism .
build: env gen
go mod tidy && go build -ldflags "-s -w" -o prism .
run: build
./prism -n $(DEV)

View File

@@ -48,5 +48,5 @@ make build
compile by docker
```bash
docker run --rm -v /root/prism:/root/prism ebpf-build:v22.04-llvm-14 bash -c "cd /root/prism && make build"
docker run --rm -v /root/prism:/root/prism ghcr.io/cilium/ebpf-builder:1694533004 bash -c "cd /root/prism && make build"
```

View File

@@ -30,7 +30,7 @@ const (
func ParseHttp(data []byte) error {
if Debug && Verbose {
log.Printf("data:%+v", data)
log.Printf("[PACKAGE] data:%+v", data)
}
flyHttp, err := extractFlyHttp(data)