From 383999d1d41f5f6340c8e84d45e8d1b8de4908d5 Mon Sep 17 00:00:00 2001 From: Daniel Hrabovcak Date: Fri, 19 Jul 2024 09:32:17 -0400 Subject: [PATCH] feat: reintroduce amtool --- Dockerfile | 8 ++++++++ cmd/amtool/boring.go | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 cmd/amtool/boring.go diff --git a/Dockerfile b/Dockerfile index 249217e34..50108d20a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,9 +13,17 @@ RUN CGO_ENABLED=1 GOEXPERIMENT=boringcrypto \ -ldflags="-X github.com/prometheus/common/version.Version=$(cat VERSION) \ -X github.com/prometheus/common/version.BuildDate=$(date --iso-8601=seconds)" \ ./cmd/alertmanager +RUN CGO_ENABLED=1 GOEXPERIMENT=boringcrypto \ + go build \ + -tags boring \ + -mod=vendor \ + -ldflags="-X github.com/prometheus/common/version.Version=$(cat VERSION) \ + -X github.com/prometheus/common/version.BuildDate=$(date --iso-8601=seconds)" \ + ./cmd/amtool FROM ${IMAGE_BASE} COPY --from=gobase /app/alertmanager /bin/alertmanager +COPY --from=gobase /app/amtool /bin/amtool COPY --from=gobase --chown=nobody:nobody /etc/alertmanager /etc/alertmanager COPY --from=gobase --chown=nobody:nobody /alertmanager /alertmanager COPY LICENSE LICENSE diff --git a/cmd/amtool/boring.go b/cmd/amtool/boring.go new file mode 100644 index 000000000..991d18711 --- /dev/null +++ b/cmd/amtool/boring.go @@ -0,0 +1,21 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build boring + +package main + +import ( + _ "crypto/tls/fipsonly" +)