Switch the Slack bot's release image to a hardened base
@JAORMX is already working on this.
Since Sep 7, 2026.
- Dominant language
- Go
- Stars
- 152
- Forks
- 16
- Avg merge
- 14h 48m
- Merged PRs (30d)
- 536
Description
Context
The Slack bot example (sdk/typescript/examples/slack-bot) now ships a real, CI-published, signed container image (ghcr.io/stacklok/mecatl/slack-bot, added in #1054). Its docker/bot.Dockerfile still builds on plain node:24-slim — not a hardened base. Raised by Samuele during #1054's review; deferred deliberately rather than done in that PR. Full reasoning is already written as a comment directly above the FROM line in docker/bot.Dockerfile.
Why it's not a one-line fix
The build currently runs corepack enable / pnpm install / pnpm run build inside the final image. A hardened runtime tag (minimal, distroless-style) almost certainly has neither a shell nor a package manager, so this needs a real multi-stage rewrite:
- Builder stage: a
-dev/full variant (has the toolchain) — installs deps, buildsdist/, prunesnode_modulesto production-only. - Runtime stage: the minimal hardened tag —
COPYin justdist/+ the prunednode_modules, runnode dist/index.jsdirectly. No corepack/pnpm/shell needed at runtime at all.
Recommendation: Chainguard over Docker Hardened Images
cgr.dev/chainguard/node: free, no registry login to pull. This repo already depends on this vendor for every other released image —mecated/mecak8s/mecatuibuild oncgr.dev/chainguard/static(see.ko.yaml). Adopting it here is zero new vendor relationship, zero new CI credentials.- One wrinkle: only
latest/latest-devare pullable for free; a specific pinned version tag needs a Chainguard sales conversation. Workaround, already precedented in.ko.yaml: pin the digest oflatestat build time, not the moving tag.
- One wrinkle: only
- Docker Hardened Images (docker.com/products/hardened-images): also genuinely free (Apache 2.0, unpaywalled catalog) and has a Node.js image, but pulling from
dhi.iorequiresdocker login dhi.ioeven on the free tier — a new credential that would need to be provisioned and stored as a GitHub secret in this repo's CI. Their "change one line in your Dockerfile" pitch doesn't mention that.
Scope
- Rewrite
docker/bot.Dockerfileas multi-stage per above. - Verify the resulting image still runs correctly (Socket Mode connects, gRPC to a real/mock
mecatedworks) — not just that it builds. - Update the CI comment/notes in
.github/workflows/release.yml'spublish-slack-botjob if the build context or Dockerfile path changes.
Not urgent, not blocking anything — tracked so it doesn't quietly disappear.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.