Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: get rid of CGO (#983)

qsliu5f5291e0c9db
diff --git a/Dockerfile b/Dockerfile
index 4347d7e510..a4378e82ff 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -28,9 +28,6 @@ ARG GIT_COMMIT="unknown"
ARG BUILD_TIME="unknown"
ARG BUILD_USER="unknown"
-# Need gcc musl-dev for CGO_ENABLED=1
-RUN apk --no-cache add gcc musl-dev
-
WORKDIR /backend-build
COPY . .
@@ -39,8 +36,7 @@ COPY . .
COPY --from=frontend /frontend-build/dist ./server/dist
# -ldflags="-w -s" means omit DWARF symbol table and the symbol table and debug information
-# go-sqlite3 requires CGO_ENABLED
-RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
+RUN GOOS=linux GOARCH=amd64 go build \
--tags "release alpine" \
-ldflags="-w -s -X 'github.com/bytebase/bytebase/bin/server/cmd.version=${VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.goversion=${GO_VERSION}' -X 'github.com/bytebase/bytebase/bin/server/cmd.gitcommit=${GIT_COMMIT}' -X 'github.com/bytebase/bytebase/bin/server/cmd.buildtime=${BUILD_TIME}' -X 'github.com/bytebase/bytebase/bin/server/cmd.builduser=${BUILD_USER}'" \
-o bytebase \