Skip to content

feat(container): support env var expansion in consuming commands - #2023

Open
gandie wants to merge 7 commits into
masterfrom
feat/support-env-expand
Open

feat(container): support env var expansion in consuming commands#2023
gandie wants to merge 7 commits into
masterfrom
feat/support-env-expand

Conversation

@gandie

@gandie gandie commented Jul 21, 2026

Copy link
Copy Markdown
Member

Resolve #1572

Tested in fish shell:

set -x POSTGRES_PASSWORD 'yoursecrethere'
mw container run -e POSTGRES_PASSWORD postgres:latest

Container spawns with password and starts without errors.

@martin-helmich martin-helmich changed the title Support env var expansion in consuming commands feat(container): support env var expansion in consuming commands Jul 24, 2026
Comment thread src/commands/container/run.tsx Outdated
@gandie
gandie requested a review from martin-helmich July 27, 2026 09:24
Comment thread src/lib/resources/container/common-flags.ts Outdated
Comment thread src/lib/resources/container/common-flags.ts Outdated
Comment on lines +53 to +59
export function makeContainerDescriptionFlagOptions(summary: string) {
return Flags.custom<string>({
summary,
description: "This helps identify the container's purpose or contents.",
required: false,
})();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Flags.custom already exports a constructor function; the idiomatic usage would be this:

// Export
export const containerDescriptionFlag = Flags.custom<string>({
  summary,
  description: "This helps identify the container's purpose or contents.",
  required: false,
});

// Usage
const flags = {
  description = containerDescriptionFlag({
    summary: "boo"
  })
}

Comment on lines 62 to 64
summary: "override the default entrypoint of the container image",
description:
"The entrypoint is the command that will be executed when the container starts. If omitted, the entrypoint defined in the image will be used.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we could also move summary+description to the custom flag definition

Comment on lines 73 to 74
summary: "publish a container's port(s)",
description:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we could also move summary+description to the custom flag definition

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.

"docker run" compatibility for environment variables without values

2 participants