Skip to content

Support multiple Docker build secrets via newline-delimited input - #159

Draft
nickstenning wants to merge 1 commit into
mainfrom
multiple-build-secrets
Draft

Support multiple Docker build secrets via newline-delimited input#159
nickstenning wants to merge 1 commit into
mainfrom
multiple-build-secrets

Conversation

@nickstenning

@nickstenning nickstenning commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

The build-secrets input was passed to astro deploy --build-secrets as a single argument, and the CLI in turn passed it to docker build as a single --secret flag, so there was no way to expose more than one secret to the image build: Docker parses the whole value as one secret spec in which later fields override earlier ones.

Change the input to accept a newline-delimited list. Each line is passed to the CLI as its own --build-secret flag.

As a side benefit, this input value is now threaded through the environment rather than interpolated into the script, so values containing shell metacharacters can no longer break (or inject into) the options-building step.

Fixes #72.

Note: this cannot be merged until astronomer/astro-cli#2212 is merged and released.

The build-secrets input was passed to `astro deploy --build-secrets` as
a single argument, and the CLI in turn passed it to `docker build` as a
single --secret flag, so there was no way to expose more than one secret
to the image build: Docker parses the whole value as one secret spec in
which later fields override earlier ones.

Change the input to accept a newline-delimited list. Each line is passed
to the CLI as its own `--build-secret` flag.

As a side benefit, this input value is now threaded through the
environment rather than interpolated into the script, so values
containing shell metacharacters can no longer break (or inject into) the
options-building step.
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.

Handling multiple secrets in build-secrets

2 participants