Skip to content

Add support for build secrets#1300

Merged
JaewonHur merged 4 commits intoapple:mainfrom
percontation:secrets
Mar 17, 2026
Merged

Add support for build secrets#1300
JaewonHur merged 4 commits intoapple:mainfrom
percontation:secrets

Conversation

@percontation
Copy link
Contributor

@percontation percontation commented Mar 7, 2026

docker-compatible --secret id=key,... arg for container build, that works with Dockerfiles with RUN --mount=type=secret

Requires apple/container-builder-shim#69

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Adds support for Dockerfiles that use build secrets (e.g. RUN --mount=type=secret ...)

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

@percontation
Copy link
Contributor Author

percontation commented Mar 7, 2026

I haven't done much Swift before, so watch out for any stupid mistakes I may have made.

One design caveat: I passed secrets by copying the build-args code, because they're functionally the same. But, systems are supposed to take care that the secret values aren't logged or stored anywhere, so HTTP headers are a much riskier way to send them than transporting them separately in a new BuildTransfer. I nevertheless used the headers to send the secrets because 1. it seemed easier 2. I didn't notice anything that would log or record these headers 3. it looked like the headers and BuildTransfers alike are just data sent through gRPC, so, not much practical difference right now.

@percontation percontation force-pushed the secrets branch 2 times, most recently from 09b5a6b to 4d849b2 Compare March 16, 2026 19:43
@JaewonHur
Copy link
Contributor

Hi @percontation, could you resolve conflicts one last time? and we can merge it!

docker-compatible `container build --secret id=key,...`
for Dockerfile `RUN --mount=type=secret`
@JaewonHur JaewonHur merged commit a00ec5c into apple:main Mar 17, 2026
3 checks passed
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