diff --git a/Sources/Services/ContainerAPIService/Client/Parser.swift b/Sources/Services/ContainerAPIService/Client/Parser.swift index 2306da739..6342cb9b7 100644 --- a/Sources/Services/ContainerAPIService/Client/Parser.swift +++ b/Sources/Services/ContainerAPIService/Client/Parser.swift @@ -772,14 +772,15 @@ public struct Parser { // Parse a single `--publish-socket`` argument into a `PublishSocket`. public static func publishSocket(_ socketText: String) throws -> PublishSocket { - // Split by colon to two parts: [host_path, container_path] - let parts = socketText.split(separator: ":") - - switch parts.count { - case 2: + // The host path may itself contain ':' (e.g. a timestamped filename), + // so split on the LAST ':' rather than requiring exactly one. The + // container path is always a simple absolute path and is validated + // as such below, mirroring the approach used for `container cp` path + // references. + if let colon = socketText.lastIndex(of: ":") { // Extract host and container paths - let hostPath = String(parts[0]) - let containerPath = String(parts[1]) + let hostPath = String(socketText[..