Skip to content

Add TLS-aware Docker context resolution in coast-docker#1

Closed
agustif wants to merge 1 commit intoaf/docker-context-resolutionfrom
af/docker-context-tls
Closed

Add TLS-aware Docker context resolution in coast-docker#1
agustif wants to merge 1 commit intoaf/docker-context-resolutionfrom
af/docker-context-tls

Conversation

@agustif
Copy link
Owner

@agustif agustif commented Mar 12, 2026

Summary

Draft follow-up for coast-guard#63, stacked on top of the Docker-context resolver work from coast-guard#61.

This PR adds TLS-aware Docker context resolution inside coast-docker::host only.

What changed

  • extends the resolved endpoint model with optional TLS material
  • computes context TLS storage from the Docker context metadata location
  • supports both:
    • <TLSPath>/docker/{ca,cert,key}.pem
    • <TLSPath>/{ca,cert,key}.pem
  • transport selection for context-driven endpoints becomes:
    • unix:// / npipe:// -> socket path
    • tcp:// / http:// without TLS material -> HTTP
    • tcp:// / https:// with TLS material -> TLS
    • ssh:// -> explicit unsupported error
  • explicit env-driven DOCKER_HOST / DOCKER_TLS_VERIFY / DOCKER_CERT_PATH behavior is still delegated to Bollard defaults

Why this is stacked

This depends directly on the shared resolver introduced in coast-guard#61. To keep the diff small, this draft is based on that branch instead of opening a larger PR against main.

Validation

  • cargo test -p coast-docker --lib
  • cargo test -p coast-cli doctor:: -- --nocapture

Out of scope

  • SSH Docker contexts
  • broader daemon / CLI diagnostics polish
  • unrelated coast-guard build fixes

Extend `coast-docker::host` so context-driven Docker endpoints can resolve TLS transport from Docker context storage. Preserve explicit env-driven DOCKER_HOST / DOCKER_TLS_VERIFY / DOCKER_CERT_PATH behavior by continuing to defer that path to Bollard's env-aware defaults. Reject ssh:// contexts explicitly in this slice.

Refs: coast-guard#63

Co-authored-by: Codex <noreply@openai.com>
@agustif
Copy link
Owner Author

agustif commented Mar 12, 2026

Closing in favor of upstream draft PR coast-guard#64.

@agustif agustif closed this Mar 12, 2026
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