Skip to content

Commit f90947c

Browse files
committed
fix bug image of example-log-receiver can not run
Signed-off-by: wanjunlei <[email protected]>
1 parent 50665cc commit f90947c

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

docs/user-guides/forwarding-logs-via-http/Dockerfile

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
FROM golang:1.14-stretch
1+
# Build the manager binary
2+
FROM golang:1.14 as builder
23

4+
WORKDIR /
35
COPY main.go /go/src/main.go
4-
RUN go build /go/src/main.go
6+
RUN CGO_ENABLED=0 go build /go/src/main.go
7+
8+
# Use distroless as minimal base image to package the manager binary
9+
# Refer to https://github.com/GoogleContainerTools/distroless for more details
10+
FROM gcr.io/distroless/static:nonroot
11+
WORKDIR /
12+
COPY --from=builder /main .
13+
USER nonroot:nonroot
14+
15+
ENTRYPOINT ["/main"]
516

6-
CMD ["/main"]

docs/user-guides/forwarding-logs-via-http/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This tutorial guides you on how to filter error logs and send them out via HTTP.
77
First, deploy HTTP sample server for receiving logs (see main.go).
88

99
```shell
10-
kubectl create deploy log-receiver --image=kubespheredev/example-log-receiver --port=8080
10+
kubectl create deploy log-receiver --image=kubespheredev/example-log-receiver
1111
kubectl expose deploy log-receiver --port=8080 --target-port=8080
1212
```
1313
Second, setup the logging pipeline. It deploys a log generator and logging agents (fluent bit). The logging agent will forward all error logs containing `ERRO` to the sample server above.

0 commit comments

Comments
 (0)