Skip to content

feat(docker): add memory, read-only, no-new-privileges and user to Container - #2185

Draft
rickyeescobar wants to merge 3 commits into
alchemy-run:mainfrom
rickyeescobar:docker-container-hardening
Draft

rickyeescobar wants to merge 3 commits into
alchemy-run:mainfrom
rickyeescobar:docker-container-hardening

Conversation

@rickyeescobar

Copy link
Copy Markdown

Docker.Container can now limit memory and harden the runtime.

const api = yield* Docker.Container("api", {
  image: "ghcr.io/acme/api:latest",
  memory: "512m",
  memorySwap: "512m",
  readOnly: true,
  noNewPrivileges: true,
  user: "1000:1000",
  volumes: [{ hostPath: "api-tmp", containerPath: "/tmp" }],
});
  • memory and memorySwap take Docker's byte-suffix format and map to --memory and --memory-swap.
  • readOnly maps to --read-only, noNewPrivileges to --security-opt no-new-privileges, user to --user.
  • All five are create-time options: changing one replaces the container. Unset props add no key to the config hash, so containers created before this change keep their hash and are not recreated.

Stacked on #2182 and #2183.

🤖 Generated with Claude Code

rickyeescobar and others added 3 commits October 9, 2026 16:44
A PKCS#10 certificate signing request built locally from an `ec`, `rsa`
or `ed25519` PEM private key, usually one minted by `KeyPair`, for
certificate resources such as `Cloudflare.OriginCaCertificate`.

ECDSA and RSA signatures are randomized, so the CSR is kept in state and
rebuilt only when the key fingerprint, the common name or the set of DNS
names changes. The DER encoder moves from `ACME/Der.ts` to `Util/Der.ts`
so `ACME.Pki` and `CertRequest` share it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`Command.Exec` gains an optional `destroyCommand` that runs on delete with
the `cwd`, `env`, `shell` and `timeout` of the last deploy, for a final
backup or a deregistration call. A non-zero exit fails the destroy and
keeps the state row.

An edit to `destroyCommand` alone is saved without re-running `command`:
a noop never persists props and `delete` reads the command from state.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ntainer

`Docker.Container` gains `memory`, `memorySwap`, `readOnly`,
`noNewPrivileges` and `user`, forwarded as `docker container create`
options. They are create-time props, so a change replaces the container.
Unset props add no key to the container's config hash, so existing
containers are not recreated on upgrade.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant