mirror of
https://github.com/docker/buildx.git
synced 2024-11-22 15:37:16 +08:00
bake: support compose secrets env
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
50c23aa755
commit
e0350f671a
@ -235,6 +235,9 @@ func composeToBuildkitSecret(inp compose.ServiceSecretConfig, psecret compose.Se
|
||||
if psecret.File != "" {
|
||||
bkattrs = append(bkattrs, "src="+psecret.File)
|
||||
}
|
||||
if psecret.Environment != "" {
|
||||
bkattrs = append(bkattrs, "env="+psecret.Environment)
|
||||
}
|
||||
|
||||
return strings.Join(bkattrs, ","), nil
|
||||
}
|
||||
|
@ -24,10 +24,11 @@ services:
|
||||
args:
|
||||
buildno: 123
|
||||
secrets:
|
||||
- ENV_TOKEN
|
||||
- token
|
||||
- aws
|
||||
secrets:
|
||||
ENV_TOKEN: {}
|
||||
token:
|
||||
environment: ENV_TOKEN
|
||||
aws:
|
||||
file: /root/.aws/credentials
|
||||
`)
|
||||
@ -54,7 +55,7 @@ secrets:
|
||||
require.Equal(t, "123", c.Targets[1].Args["buildno"])
|
||||
require.Equal(t, "none", *c.Targets[1].NetworkMode)
|
||||
require.Equal(t, []string{
|
||||
"id=ENV_TOKEN",
|
||||
"id=token,env=ENV_TOKEN",
|
||||
"id=aws,src=/root/.aws/credentials",
|
||||
}, c.Targets[1].Secrets)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user