Skip to content

Commit 6d0cc53

Browse files
committed
docker: ensure the hubble binary is statially linked
From the CGO documentation[0]: > The cgo tool is enabled by default for native builds on systems where > it is expected to work. It is disabled by default when > cross-compiling. You can control this by setting the CGO_ENABLED > environment variable when running the go tool: set it to 1 to enable > the use of cgo, and to 0 to disable it. This commits enforces disabling CGO to ensure that the hubble binary is statically linked. [0]: https://golang.org/cmd/cgo/ Signed-off-by: Robin Hahling <[email protected]>
1 parent 9f058a4 commit 6d0cc53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM docker.io/library/golang:1.14.3-alpine3.11 as builder
22
WORKDIR /go/src/github.com/cilium/hubble
33
RUN apk add --no-cache git make
44
COPY . .
5-
RUN make clean && make hubble
5+
RUN make clean && CGO_ENABLED=0 make hubble
66

77
FROM docker.io/library/alpine:3.11
88
RUN apk add --no-cache bash curl jq

0 commit comments

Comments
 (0)