forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The build is done inside a docker container using Redhat’s continer image for golang-fips. The same commands (`build.sh <arch> build`) as before should yield a telegraf binary for the different architectures (arm64, mips, amd64 etc.). The legacy behavior of building the code using the host’s go is now available as `build.sh <arch> host`. Depending on the golang toolchain this might/might not yield a binary that uses OpenSSL for crypto. The telegraf binary will run in FIPS mode if: - The kernel is in FIPS mode (i.e. /proc/sys/crypto/fips_enabled) - The environment varilable GOLANGS_FIPS=1 is set
- Loading branch information
Showing
3 changed files
with
84 additions
and
21 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM registry.access.redhat.com/ubi8/go-toolset:latest as golang | ||
WORKDIR /root/go/src/github.com/extremenetworks/telegraf | ||
|
||
COPY .git .git | ||
COPY agent agent | ||
COPY cmd cmd | ||
COPY config config | ||
COPY filter filter | ||
COPY internal internal | ||
COPY logger logger | ||
COPY metric metric | ||
COPY models models | ||
COPY plugins plugins | ||
COPY selfstat selfstat | ||
COPY *.go go.* ./ | ||
COPY build_version.txt ./ | ||
COPY Makefile ./ | ||
|
||
|
||
FROM golang as builder | ||
ARG OPTS | ||
|
||
RUN \ | ||
git config --global user.email "[email protected]" && git config --global user.name "Dev Extreme" \ | ||
&& \ | ||
git config --global --add safe.directory /root/go/src/github.com/extremenetworks/telegraf \ | ||
&& \ | ||
make ${OPTS} all go-install | ||
|
||
|
||
FROM scratch as extract | ||
COPY --from=builder /opt/app-root/src/go/bin/telegraf /telegraf | ||
|
||
|
||
FROM registry.access.redhat.com/ubi8/ubi-micro:latest as final | ||
COPY --from=extract /telegraf /usr/bin/telegraf |
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
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 +1 @@ | ||
12 | ||
13 |