File tree Expand file tree Collapse file tree
06-building-container-images/api-golang Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ COPY . .
1616# Add flags to statically link binary
1717RUN go build \
1818 -ldflags="-linkmode external -extldflags -static" \
19+ -tags netgo \
1920 -o api-golang
2021
2122# Use separate stage for deployable image
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ COPY . .
1616# Add flags to statically link binary
1717RUN go build \
1818 -ldflags="-linkmode external -extldflags -static" \
19+ -tags netgo \
1920 -o api-golang
2021
2122# Use separate stage for deployable image
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ COPY . .
2222# Add flags to statically link binary
2323RUN go build \
2424 -ldflags="-linkmode external -extldflags -static" \
25+ -tags netgo \
2526 -o api-golang
2627
2728# Use separate stage for deployable image
You can’t perform that action at this time.
0 commit comments