Skip to content

Commit

Permalink
set vmagent build version (VictoriaMetrics#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
hardproblems authored and GitHub Enterprise committed Apr 19, 2024
1 parent a880041 commit a42cdc2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions vmagent-abnb.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ ARG GO_VERSION=1.22.2
RUN /jorb/scripts/install-go.sh ${GO_VERSION}
#########

RUN apt-get install -y ca-certificates git gcc musl-dev make wget && \
# Adapted from builder/Dockerfile
RUN apt-get install -y git gcc musl-dev make wget && \
mkdir /opt/cross-builder && \
wget https://musl.cc/aarch64-linux-musl-cross.tgz -O /opt/cross-builder/aarch64-musl.tgz --no-verbose && \
cd /opt/cross-builder && \
Expand All @@ -19,12 +20,15 @@ ENV GOMAXTHREADS=3
ENV PATH="/usr/local/go/bin:$GOPATH/bin:$PATH"
ENV GO=go

ARG PLATFORM
ARG SHA

COPY go.sum .
COPY go.mod .
COPY . .

RUN go build -trimpath -buildvcs=false \
-ldflags "-extldflags '-static' " \
-ldflags "-extldflags '-static' -X 'github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo.Version=vmagent-abnb-${SHA}-${PLATFORM}' " \
-tags 'netgo osusergo nethttpomithttp2 musl' \
-o /vmagent-prod github.com/VictoriaMetrics/VictoriaMetrics/app/vmagent

Expand Down

0 comments on commit a42cdc2

Please sign in to comment.