Skip to content

Commit

Permalink
CMOS-177 Use -tags netgo for cgo builds (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
markspolakovs committed Nov 23, 2021
1 parent 09dd8f9 commit c161d7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions microlith/Dockerfile
Expand Up @@ -21,7 +21,7 @@ ARG PROM_CONFIG_TOOL_VERSION=v0.3.0
WORKDIR /src/github.com/lablabs/prometheus-alert-overrider
RUN curl -Lo /src/prom.tgz "https://github.com/lablabs/prometheus-alert-overrider/archive/refs/tags/$PROM_CONFIG_TOOL_VERSION.tar.gz" && \
tar --strip-components 1 -xzvf /src/prom.tgz && \
CGO_ENABLED=1 GOOS=linux go build -trimpath -a -ldflags '-linkmode external -extldflags "-static"' -o /bin/prometheus_merge main.go
CGO_ENABLED=1 GOOS=linux go build -trimpath -a -ldflags '-linkmode external -extldflags "-static"' -tags netgo -o /bin/prometheus_merge main.go

# Build the configuration service
WORKDIR /src/github.com/couchbaselabs/observability/config-svc
Expand All @@ -39,8 +39,8 @@ RUN git rev-parse HEAD > /etc/couchbase/git-commit.txt

# Statically build it to allow reuse on Alpine Linux
RUN go mod download && \
CGO_ENABLED=1 GOOS=linux go build -trimpath -a -ldflags '-linkmode external -extldflags "-static"' -o /bin/cbmultimanager ./cluster-monitor/cmd/cbmultimanager && \
CGO_ENABLED=1 GOOS=linux go build -trimpath -a -ldflags '-linkmode external -extldflags "-static"' -o /bin/cbeventlog ./cluster-monitor/cmd/cbeventlog
CGO_ENABLED=1 GOOS=linux go build -trimpath -a -ldflags '-linkmode external -extldflags "-static"' -tags netgo -o /bin/cbmultimanager ./cluster-monitor/cmd/cbmultimanager && \
CGO_ENABLED=1 GOOS=linux go build -trimpath -a -ldflags '-linkmode external -extldflags "-static"' -tags netgo -o /bin/cbeventlog ./cluster-monitor/cmd/cbeventlog

FROM node:16-alpine3.14 as ui-builder

Expand Down

0 comments on commit c161d7b

Please sign in to comment.