fix(publish): accept short-form port mappings (fixes #13672) - #13849
fix(publish): accept short-form port mappings (fixes #13672)#13849Ijtihed wants to merge 1 commit into
Conversation
|
i have one question regarding coverage: ports:
- "8080:80"
- "127.0.0.1:8080:80"
- "${PORT:-8080}:80"It may be worth adding or extending tests to cover a few representative short-form variants to ensure the publish path remains aligned with Compose port syntax support |
Signed-off-by: Ijtihed Kilani <ijtihedk@gmail.com>
c8cdd16 to
523c51c
Compare
Agree, done |
Import Docker Compose-derived OCI artifact push helpers and YAML path replacement utilities for the publish slice. Upstream-Ref: docker/compose#13849 Bug-Ref: docker/compose#13672 Bug-Ref: docker/compose#13722 Release-Note: none
Implement container compose publish for image-backed Compose projects with preflight validation, service image pushes, OCI project artifact manifests, env-file layers, dry-run planning, OCI version selection, and deterministic --yes bind-mount acceptance.
Refresh README, STATUS, release docs, parity docs, examples, and upstream handoff drafts so the documentation describes the current publish surface and remaining gaps without duplicated runtime pins.
Release-Highlight: container compose publish now pushes service images and creates Docker Compose OCI project artifacts for image-backed projects, including --dry-run planning, --oci-version 1.0/1.1/auto, --with-env env-file layers, --yes bind-mount acceptance, and short-form ports such as ${DASHBOARD_PORT:-3000}:3000. Upstream references: docker/compose#13849, docker/compose#13672, docker/compose#13722.
Upstream-Ref: docker/compose#13849
Bug-Ref: docker/compose#13672
Bug-Ref: docker/compose#13722
Support container compose publish --resolve-image-digests by resolving service image tags after the service image push step and appending a Docker Compose-compatible image-digests.yaml override layer to the published OCI project artifact. Keep dry-run publish deterministic by running the existing preflight first, emitting the dry-run service image pushes, and only then producing the digest-resolved dry-run artifact plan. Refresh README, BUILD, STATUS, and publish handoff docs so parity and remaining publish gaps reflect the current surface. Release-Highlight: container compose publish --resolve-image-digests now adds Docker Compose-compatible image-digests.yaml layers so published OCI project artifacts can pin service images to registry digests after service image push. Upstream-Ref: docker/compose#13257 Upstream-Ref: docker/compose#13238 Upstream-Ref: docker/compose#13849 Refs: docker/compose#13672 Refs: docker/compose#13722
Add Docker Compose-compatible publish prompts for bind mounts, sensitive-looking data, env declarations, literal config content, and optional missing env_file handling. The implementation keeps the raw YAML preflight path so pinned compose-go short-form port behavior remains compatible while publish prompts use a shared input reader. Sensitive findings are redacted in prompt output so the warning itself does not leak detected secret values. Release-Note: container compose publish now supports Docker-compatible interactive safety prompts for bind mounts, sensitive-looking data, env declarations, and literal config content; --yes accepts all publish prompts for CI. Upstream-Ref: docker/compose@eb4b1cc Upstream-Ref: docker/compose@9cd8442 Bug-Ref: docker/compose#13394 Refs: docker/compose#13722 Refs: docker/compose#13849
| @@ -724,11 +725,24 @@ func (s *composeService) checkForSensitiveData(ctx context.Context, project *typ | |||
| } | |||
|
|
|||
| func composeFileAsByteReader(ctx context.Context, filePath string, project *types.Project) (io.Reader, error) { | |||
There was a problem hiding this comment.
I wonder we actually need to parse the compose file here. This func is only used by checkForSensitiveData and disables all compose-go processing to get raw file, so we could just open compose file as a raw text file and let ScanReader process. A user to use a non-yaml file here would anyway get a parsing error from other steps in the publish pipeline
What I did
docker compose publishfailed with'services[whoami].ports[0]' expected a map or struct, got "string"when a service used short-form port syntax like${DASHBOARD_PORT:-3000}:3000.composeFileAsByteReaderusedLoadWithContextwhich decodes ports into typed Go structs which rejects short-form string entries. Switching toLoadModelWithContextreturns a raw map instead which in ths case avoids the struct decodeRelated issue
Fixes #13672