stacklok / stacklok/mecatl

Switch the Slack bot's release image to a hardened base

Open
#1,085 0 comments 0 reactions 1 assignee View on GitHub

@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, builds dist/, prunes node_modules to production-only.
  • Runtime stage: the minimal hardened tag — COPY in just dist/ + the pruned node_modules, run node dist/index.js directly. 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/mecatui build on cgr.dev/chainguard/static (see .ko.yaml). Adopting it here is zero new vendor relationship, zero new CI credentials.
    • One wrinkle: only latest/latest-dev are pullable for free; a specific pinned version tag needs a Chainguard sales conversation. Workaround, already precedented in .ko.yaml: pin the digest of latest at build time, not the moving tag.
  • 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.io requires docker login dhi.io even 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.Dockerfile as multi-stage per above.
  • Verify the resulting image still runs correctly (Socket Mode connects, gRPC to a real/mock mecated works) — not just that it builds.
  • Update the CI comment/notes in .github/workflows/release.yml's publish-slack-bot job if the build context or Dockerfile path changes.

Not urgent, not blocking anything — tracked so it doesn't quietly disappear.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.