Skip to content

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

fix: distrust compromised eMudhra certificates in container images (#21634)

p0nyc0714e03f2f4
diff --git a/scripts/Dockerfile b/scripts/Dockerfile
index 1c44b6e3d6..aa2d6b3208 100644
--- a/scripts/Dockerfile
+++ b/scripts/Dockerfile
@@ -10,14 +10,14 @@ COPY . .
RUN pnpm --dir ./frontend i
RUN pnpm --dir ./frontend release-docker
-FROM golang:1.27.1-alpine3.23 AS backend
+FROM golang:1.27.3-alpine3.24 AS backend
ARG VERSION
ARG GIT_COMMIT
ADD go.mod go.sum /
RUN go mod download
-RUN apk add --no-cache clang krb5-dev binutils-gold
+RUN apk add --no-cache clang gcc binutils krb5-dev
WORKDIR /backend-build
@@ -32,7 +32,7 @@ RUN CC=clang go build \
-ldflags="-extldflags '-Wl,-z,stack-size=0x1000000' -w -s -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.version=${VERSION}' -X 'github.com/bytebase/bytebase/backend/bin/server/cmd.gitcommit=${GIT_COMMIT}'" \
-o bytebase ./backend/bin/server/main.go
-FROM alpine:3.24 AS monolithic
+FROM alpine:3.24.3 AS monolithic
ARG VERSION
ARG GIT_COMMIT
@@ -45,7 +45,7 @@ RUN addgroup --gid 113 --system bytebase && adduser --uid 113 --system bytebase
# Directory to store the data, which can be referenced as the mounting point.
RUN mkdir -p /var/opt/bytebase
RUN apk update
-RUN apk add --no-cache gnupg curl psmisc procps ncurses krb5
+RUN apk add --no-cache ca-certificates gnupg curl psmisc procps ncurses krb5
# Install postgresql.
RUN apk add postgresql16
# Generate en_US.UTF-8 locale which is needed to start postgres server.
@@ -55,7 +55,6 @@ RUN apk add postgresql16
# The file indicates running in docker environment.
RUN touch /etc/bb.env
COPY --from=backend /backend-build/bytebase /usr/local/bin/
-COPY --from=backend /etc/ssl/certs /etc/ssl/certs
ENV OPENSSL_CONF=/etc/ssl/
ENV GOGC=50
diff --git a/scripts/Dockerfile.action b/scripts/Dockerfile.action
index 9b7a4f7988..a16003166e 100644
--- a/scripts/Dockerfile.action
+++ b/scripts/Dockerfile.action
@@ -1,18 +1,17 @@
-FROM golang:1.27.1-alpine3.23 AS builder
+FROM golang:1.27.3-alpine3.24 AS builder
ARG VERSION
ARG GIT_COMMIT
WORKDIR /action-build
COPY action/ action/
COPY . .
-RUN go build \
+RUN go build \
--ldflags="-w -s -X 'github.com/bytebase/bytebase/action/args.Version=${VERSION}' -X 'github.com/bytebase/bytebase/action/args.Gitcommit=${GIT_COMMIT}'" \
-o bytebase-action action/*.go
-FROM alpine:3.24
+FROM alpine:3.24.3
RUN apk update
# Azure DevOps pipeline requires bash.
-RUN apk add --no-cache jq bash gcompat curl
+RUN apk add --no-cache ca-certificates jq bash gcompat curl
WORKDIR /
COPY --from=builder /action-build/bytebase-action /usr/local/bin/bytebase-action
-COPY --from=builder /etc/ssl/certs /etc/ssl/certs
-CMD ["bytebase-action"]
\ No newline at end of file
+CMD ["bytebase-action"]
diff --git a/scripts/Dockerfile.action-debian b/scripts/Dockerfile.action-debian
index 90d5ffbacc..71709d41de 100644
--- a/scripts/Dockerfile.action-debian
+++ b/scripts/Dockerfile.action-debian
@@ -1,4 +1,4 @@
-FROM golang:1.27.1-bookworm AS builder
+FROM golang:1.27.3-trixie AS builder
ARG VERSION
ARG GIT_COMMIT
WORKDIR /action-build
@@ -8,9 +8,9 @@ RUN go build \
--ldflags="-X 'github.com/bytebase/bytebase/action/args.Version=${VERSION}' -X 'github.com/bytebase/bytebase/action/args.Gitcommit=${GIT_COMMIT}'" \
-o bytebase-action action/*.go
-FROM debian:bookworm-slim
-RUN apt-get update && apt-get install -y jq curl
+FROM debian:trixie-slim
+RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates jq curl \
+ && rm -rf /var/lib/apt/lists/*
WORKDIR /
COPY --from=builder /action-build/bytebase-action /usr/local/bin/bytebase-action
-COPY --from=builder /etc/ssl/certs /etc/ssl/certs
CMD ["bytebase-action"]