Skip to content

feat(docker): add Docker resources#649

Open
austinm911 wants to merge 27 commits into
alchemy-run:mainfrom
austinm911:codex/docker-v2-resources
Open

feat(docker): add Docker resources#649
austinm911 wants to merge 27 commits into
alchemy-run:mainfrom
austinm911:codex/docker-v2-resources

Conversation

@austinm911

@austinm911 austinm911 commented Jun 18, 2026

Copy link
Copy Markdown

Human Summary

  • created with xhigh gpt 5.5. Did a few passes over it

Summary

  • add alchemy/Docker with Docker Image, RemoteImage, Container, Volume, and Network resources
  • add CLI-backed Docker provider helpers with Redacted secret handling, inspect parsing, adoption/ownership behavior, and Docker-gated integration tests
  • add an upstream-generic PostgreSQL 18 Alpine Docker example under examples/docker-postgres
  • document Docker resources from source JSDoc as active Docker context/daemon resources, separate from Cloudflare.Container

Verification

  • bun vitest run test/Docker/DockerApi.test.ts test/Docker/Docker.integration.test.ts
  • bun tsgo --noEmit -p tsconfig.json
  • bun run --filter docker-postgres-example build
  • bunx oxlint packages/alchemy/src/Docker packages/alchemy/test/Docker packages/alchemy/package.json examples/docker-postgres
  • bunx oxfmt --check packages/alchemy/src/Docker packages/alchemy/test/Docker packages/alchemy/package.json examples/docker-postgres
  • bun docs:gen
  • bun run docs:check
  • bun run docs:build
  • git diff --check

Note: bun run docs:build succeeds but emits the existing Node DEP0190 child-process warning.

Comment thread examples/docker-postgres/alchemy.run.ts Outdated
Comment on lines +15 to +17
const password = yield* Config.redacted("POSTGRES_PASSWORD").pipe(
Config.withDefault(Redacted.make("alchemy-postgres")),
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use the Random resource to generate it

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread examples/docker-postgres/alchemy.run.ts Outdated
Comment on lines +52 to +56
const runtime = yield* Docker.Container.inspect(POSTGRES_CONTAINER).pipe(
Effect.catchTag("DockerCommandError", () =>
Effect.succeed(EMPTY_RUNTIME),
),
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is Docker.Container.inspect? Should this be Docker.inspectContainer?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@john-royal john-royal self-assigned this Jun 19, 2026
@sam-goodwin

Copy link
Copy Markdown
Contributor

Sorry for leaving this hanging. We'll get to it ASAP

sam-goodwin and others added 25 commits June 25, 2026 00:02
- repoint Image.ts import from ../Build/Memo.ts to ../Command/Memo.ts
  (Build/ was renamed to Command/ on main)
- migrate provider lifecycle ops from Effect.fnUntraced to Effect.fn
  to match the repo-wide stack-trace migration (b9676c5)
- register docker-postgres-example workspace in bun.lock

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Image now auto-generates its repository name via createPhysicalName
  (stack/stage/logical-id/instance-id) when no name is given, matching
  Container/Volume/Network. The resolved name is carried on props.name so
  the sync ref helpers stay deterministic across reconcile/diff/read.
- Source Image.builtAt / RemoteImage.createdAt from Docker's reported
  `Created` timestamp (new imageCreatedAt helper) instead of Date.now();
  reconcile inspects the built/tagged image for both id and creation time.
- Wrap process.cwd() in Effect.sync.
- Tests rely on engine-generated physical names instead of Date.now()
  names; adoption tests use deterministic constants with rm-before.

Co-Authored-By: Claude Opus 4.8 <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.

3 participants