Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Sources/ContainerCommands/BuildCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,20 @@ extension Application {
ignoreFileData = try? Data(contentsOf: ignoreFileURL)
}

// BUG: See https://github.com/apple/container/issues/735.
// Reject dockerfiles larger than 16kb before attempting to build.
// TODO: Remove when #735 was been resolved.
let maxDockerfileSize = 16 * 1024 // 16 KiB
guard buildFileData.count < maxDockerfileSize else {
throw ContainerizationError(
.invalidArgument,
message: """
Dockerfile size (\(buildFileData.count) bytes) exceeds the maximum allowed size of \(maxDockerfileSize) bytes. \
See https://github.com/apple/container/issues/735.
"""
)
}

let secretsData: [String: Data] = try self.secrets.mapValues { secret in
switch secret {
case .data(let data):
Expand Down