[builder]: enable ssh forwarding for container build (#1508)

This commit is contained in:
Saehej Kang
2026-08-03 08:34:48 -07:00
committed by GitHub
parent 39f12cabed
commit e87d3a030b
5 changed files with 130 additions and 8 deletions
+6
View File
@@ -268,6 +268,7 @@ public struct Builder: Sendable {
public let contentStore: ContentStore
public let buildArgs: [String]
public let secrets: [String: Data]
public let ssh: String
public let contextDir: String
public let dockerfile: Data
public let dockerignore: Data?
@@ -289,6 +290,7 @@ public struct Builder: Sendable {
contentStore: ContentStore,
buildArgs: [String],
secrets: [String: Data],
ssh: String,
contextDir: String,
dockerfile: Data,
dockerignore: Data?,
@@ -309,6 +311,7 @@ public struct Builder: Sendable {
self.contentStore = contentStore
self.buildArgs = buildArgs
self.secrets = secrets
self.ssh = ssh
self.contextDir = contextDir
self.dockerfile = dockerfile
self.dockerignore = dockerignore
@@ -356,6 +359,9 @@ public struct Builder: Sendable {
for (id, data) in config.secrets {
metadata.addString(id + "=" + data.base64EncodedString(), forKey: "secrets")
}
if config.ssh == "default" {
metadata.addString("default", forKey: "ssh")
}
for output in config.exports {
metadata.addString(try output.stringValue, forKey: "outputs")
}