Skip to content
Open
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
9 changes: 5 additions & 4 deletions Sources/Container-Compose/Commands/ComposeUp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,12 @@ public struct ComposeUp: AsyncParsableCommand, @unchecked Sendable {
print("Note: Service '\(serviceName)' is not explicitly connected to any networks. It will likely use the default bridge network.")
}

// Add hostname
// The 'hostname' field is not supported by `container run` (no --hostname
// flag); passing it would make the whole run command fail to parse.
if let hostname = service.hostname {
let resolvedHostname = resolveVariable(hostname, with: environmentVariables)
runCommandArgs.append("--hostname")
runCommandArgs.append(resolvedHostname)
print(
"Note: Service '\(serviceName)' sets 'hostname: \(hostname)', but the 'container' tool does not support setting a hostname. The field is ignored."
)
}

// Add working directory
Expand Down