Skip to content
This repository was archived by the owner on Mar 11, 2023. It is now read-only.

Commit af91729

Browse files
Merge pull request #11 from MaterializeInc/allow_specifying_target
Allow specifying target build stage
2 parents 2db0117 + 87f27c3 commit af91729

File tree

2 files changed

+12
-0
lines changed
  • cmd
    • pulumi-resource-docker-buildkit
    • pulumi-sdkgen-docker-buildkit

2 files changed

+12
-0
lines changed

cmd/pulumi-resource-docker-buildkit/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ func (k *dockerBuildkitProvider) dockerBuild(
232232
baseName := strings.Split(name, ":")[0]
233233
context := inputs["context"].StringValue()
234234
dockerfile := inputs["dockerfile"].StringValue()
235+
target := inputs["target"].StringValue()
235236
registry := inputs["registry"].ObjectValue()
236237
username := registry["username"]
237238
password := registry["password"]
@@ -269,6 +270,7 @@ func (k *dockerBuildkitProvider) dockerBuild(
269270
"--cache-from", name,
270271
"--cache-to", "type=inline",
271272
"-f", filepath.Join(context, dockerfile),
273+
"--target", target,
272274
"-t", name, "--push",
273275
context,
274276
)

cmd/pulumi-sdkgen-docker-buildkit/main.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,15 @@ func run(version string) error {
8484
Description: "The URL of the registry server hosting the image.",
8585
TypeSpec: schema.TypeSpec{Type: "string"},
8686
},
87+
"target": {
88+
Description: "The name of the target stage to build in the Dockerfile.",
89+
TypeSpec: schema.TypeSpec{Type: "string"},
90+
},
8791
},
8892
Required: []string{
8993
"dockerfile", "context", "name", "platforms",
9094
"contextDigest", "repoDigest", "registryServer",
95+
"target",
9196
},
9297
},
9398
InputProperties: map[string]schema.PropertySpec{
@@ -118,6 +123,11 @@ func run(version string) error {
118123
Items: &schema.TypeSpec{Type: "string"},
119124
},
120125
},
126+
"target": {
127+
Description: "The name of the target stage to build in the Dockerfile.",
128+
TypeSpec: schema.TypeSpec{Type: "string"},
129+
Default: "",
130+
},
121131
},
122132
RequiredInputs: []string{"name", "registry"},
123133
},

0 commit comments

Comments
 (0)