feat: update build script to use CGO_ENABLED variable for building

This commit is contained in:
Beyhan Ogur
2026-05-11 21:05:08 +03:00
parent 80c75ec40f
commit e1e69fa20a
+2 -2
View File
@@ -6,9 +6,9 @@ ENTRYPOINT="${ENTRYPOINT:-./main.go}"
LDFLAGS="${LDFLAGS:--w -s}" LDFLAGS="${LDFLAGS:--w -s}"
GOOS="${GOOS:-linux}" GOOS="${GOOS:-linux}"
echo "=> Building ${BINARY} (CGO_ENABLED=0 GOOS=${GOOS})" echo "=> Building ${BINARY} (CGO_ENABLED=${CGO_ENABLED:-1} GOOS=${GOOS})"
CGO_ENABLED=0 GOOS="${GOOS}" go build \ CGO_ENABLED="${CGO_ENABLED:-1}" GOOS="${GOOS}" go build \
-ldflags="${LDFLAGS}" \ -ldflags="${LDFLAGS}" \
-o "${BINARY}" \ -o "${BINARY}" \
"${ENTRYPOINT}" "${ENTRYPOINT}"