Skip to content

Commit 1c4385d

Browse files
bdchathamclaudealexander-sei
authored
build(docker): ship seidb in the seid image (#4488)
## Summary The seid image now ships `/usr/bin/seidb`. It builds in the builder stage, from the same source tree as `seid`. ## Why The FlatKV migration runbook runs `seidb` next to `seid` on Kubernetes through `kubectl exec -c seid`. It uses it for: - `migrate-evm-status`, `hashlog get-block`, and `dump-flatkv` - `evm-logical-digest` - the KV-repair inspect steps Today these steps have no good container to run in: - **seid image:** it has a shell and `tar`, but no `seidb`. - **sei-k8s-controller sidecar image:** it has `seidb`, but it is distroless, with no shell and no `tar`. The runbook's shell steps and `kubectl cp` fail there. Exec into the sidecar also exposes the operator keyring, because the sidecar mounts it. Building `seidb` from the seid source tree also keeps the two tools on one commit. The runbook asks for that when it says to record the `seidb` commit. ## Change - **Builder stage:** a new step builds `seidb` with `CGO_ENABLED=0`. `seidb` is pure Go and does not need `libwasmvm`. The controller's sidecar Dockerfile builds it the same way. - **Final stage:** the binary is copied next to `seid`. ## Verification - `CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ./sei-db/tools/cmd/seidb` on this branch's base (`6278fe9b1`): passed, statically linked ELF, about 15 s with a warm module cache. - No source file under `sei-db/` uses `go:embed`, so `.dockerignore` (which excludes `*.md` and `*_test.go`) removes nothing the build needs. - Not run: `docker build`, because the Docker daemon was not running on the build machine. The `docker_publish.yml` workflow builds this Dockerfile. Refs PLT-1389, PLT-1393. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: alexander-sei <alexanderh@seinetwork.io>
1 parent 078f5d1 commit 1c4385d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎Dockerfile‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,19 @@ RUN --mount=type=cache,target=/go/pkg/mod \
3737
-X '${VERSION_PKG}.BuildTags=${BUILD_TAGS}'" && \
3838
go build -tags "${BUILD_TAGS}" -ldflags "${LDFLAGS}" ${GO_BUILD_ARGS} -o /go/bin/seid ./cmd/seid
3939

40+
# seidb is pure Go, so it builds without cgo and does not link libwasmvm.
41+
RUN --mount=type=cache,target=/go/pkg/mod \
42+
--mount=type=cache,target=/root/.cache/go-build \
43+
CGO_ENABLED=0 go build -o /go/bin/seidb ./sei-db/tools/cmd/seidb
44+
4045
FROM docker.io/ubuntu:24.04@sha256:104ae83764a5119017b8e8d6218fa0832b09df65aae7d5a6de29a85d813da2fb
4146

4247
RUN apt-get update && \
4348
apt-get install -y --no-install-recommends ca-certificates && \
4449
rm -rf /var/lib/apt/lists/*
4550

4651
COPY --from=builder /go/bin/seid /usr/bin/
52+
COPY --from=builder /go/bin/seidb /usr/bin/
4753
COPY --from=seictl /usr/bin/seictl /usr/bin/
4854
COPY --from=builder /go/lib/*.so /usr/lib/
4955

0 commit comments

Comments
 (0)