Use -tags netgo flag for go build to fix DNS resolution
This commit is contained in:
@ -16,6 +16,7 @@ COPY . .
|
|||||||
# Add flags to statically link binary
|
# Add flags to statically link binary
|
||||||
RUN go build \
|
RUN go build \
|
||||||
-ldflags="-linkmode external -extldflags -static" \
|
-ldflags="-linkmode external -extldflags -static" \
|
||||||
|
-tags netgo \
|
||||||
-o api-golang
|
-o api-golang
|
||||||
|
|
||||||
# Use separate stage for deployable image
|
# Use separate stage for deployable image
|
||||||
|
|||||||
@ -16,6 +16,7 @@ COPY . .
|
|||||||
# Add flags to statically link binary
|
# Add flags to statically link binary
|
||||||
RUN go build \
|
RUN go build \
|
||||||
-ldflags="-linkmode external -extldflags -static" \
|
-ldflags="-linkmode external -extldflags -static" \
|
||||||
|
-tags netgo \
|
||||||
-o api-golang
|
-o api-golang
|
||||||
|
|
||||||
# Use separate stage for deployable image
|
# Use separate stage for deployable image
|
||||||
|
|||||||
@ -22,6 +22,7 @@ COPY . .
|
|||||||
# Add flags to statically link binary
|
# Add flags to statically link binary
|
||||||
RUN go build \
|
RUN go build \
|
||||||
-ldflags="-linkmode external -extldflags -static" \
|
-ldflags="-linkmode external -extldflags -static" \
|
||||||
|
-tags netgo \
|
||||||
-o api-golang
|
-o api-golang
|
||||||
|
|
||||||
# Use separate stage for deployable image
|
# Use separate stage for deployable image
|
||||||
|
|||||||
Reference in New Issue
Block a user