Skip to content

Commit

Permalink
use CGO_ENABLED to avoid full system crash for mac users with a IPV6 …
Browse files Browse the repository at this point in the history
…config

see this issue golang/go#52839

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
  • Loading branch information
glours committed Oct 19, 2022
1 parent 32ae036 commit 3f8d2ab
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Expand Up @@ -40,7 +40,9 @@ RUN apk add --no-cache \
protoc \
protobuf-dev
WORKDIR /src
ENV CGO_ENABLED=0
# Switching CGO to true as there is a weird issue with the Golang DNS resolver and IPV6
#https://github.com/golang/go/issues/52839
ENV CGO_ENABLED=1

FROM base AS build-base
COPY go.* .
Expand Down Expand Up @@ -92,7 +94,9 @@ RUN --mount=type=bind,target=. \
golangci-lint run --build-tags "$BUILD_TAGS" ./...

FROM build-base AS test
ARG CGO_ENABLED=0
# Switching CGO to true as there is a weird issue with the Golang DNS resolver and IPV6
#https://github.com/golang/go/issues/52839
ENV CGO_ENABLED=1
ARG BUILD_TAGS
RUN --mount=type=bind,target=. \
--mount=type=cache,target=/root/.cache \
Expand Down

0 comments on commit 3f8d2ab

Please sign in to comment.