-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[elastic log driver] Use CrossBuild to build binary (#16039)
* init commit of using crossbuild * add debug string * change build target * bug fixes
- Loading branch information
1 parent
61253f1
commit ec7b9a9
Showing
3 changed files
with
62 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,4 @@ | ||
ARG versionString | ||
FROM golang:${versionString} as builder | ||
|
||
WORKDIR /go/src/github.com/elastic/beats/x-pack/dockerlogbeat | ||
COPY . ../.. | ||
|
||
ENV GOPATH=/go | ||
ARG GOOS=linux | ||
ARG GOARCH=amd64 | ||
ARG GOARM= | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o dockerlogbeat | ||
|
||
|
||
FROM alpine:3.7 as final | ||
FROM alpine:3.7 | ||
RUN apk --no-cache add ca-certificates | ||
RUN mkdir /contmount | ||
COPY --from=builder /go/src/github.com/elastic/beats/x-pack/dockerlogbeat/dockerlogbeat /usr/bin/dockerlogbeat | ||
COPY build/plugin/dockerlogbeat /usr/bin/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,36 @@ | ||
{ | ||
"description": "A beat for docker logs", | ||
"documentation": "https://docs.docker.com/engine/extend/plugin_api/", | ||
"entrypoint": ["/usr/bin/dockerlogbeat"], | ||
"network": { | ||
"type": "host" | ||
"description": "A beat for docker logs", | ||
"documentation": "https://docs.docker.com/engine/extend/plugin_api/", | ||
"entrypoint": [ | ||
"/usr/bin/dockerlogbeat" | ||
], | ||
"network": { | ||
"type": "host" | ||
}, | ||
"interface": { | ||
"types": [ | ||
"docker.logdriver/1.0" | ||
], | ||
"socket": "beatSocket.sock" | ||
}, | ||
"env": [ | ||
{ | ||
"description": "debug level", | ||
"name": "LOG_DRIVER_LEVEL", | ||
"value": "info", | ||
"Settable": [ | ||
"value" | ||
] | ||
}, | ||
"interface": { | ||
"types": ["docker.logdriver/1.0"], | ||
"socket": "beatSocket.sock" | ||
{ | ||
"description": "Remove strict config file checking, as there is no config file", | ||
"name": "BEAT_STRICT_PERMS", | ||
"value": "false" | ||
}, | ||
"env":[ | ||
{ | ||
"description": "debug level", | ||
"name": "LOG_DRIVER_LEVEL", | ||
"value": "info", | ||
"Settable": [ | ||
"value" | ||
] | ||
}, | ||
{ | ||
"description": "libbeat env hack", | ||
"name": "BEAT_STRICT_PERMS", | ||
"value": "false" | ||
}, | ||
{ | ||
"description": "config for dockerlogbeat", | ||
"name": "BEAT_UNIX_SOCK_PATH", | ||
"value": "/contmount/controller.sock" | ||
} | ||
] | ||
} | ||
{ | ||
"description": "config for dockerlogbeat", | ||
"name": "BEAT_UNIX_SOCK_PATH", | ||
"value": "/contmount/controller.sock" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters