Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions Sources/ContainerClient/Flags.swift
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ public struct Flags {
@Flag(name: [.customLong("rm"), .long], help: "Remove the container after it stops")
public var remove = false

@Flag(name: .long, help: "Enable Rosetta in the container")
public var rosetta = false

@Flag(name: .long, help: "Forward SSH agent socket to container")
public var ssh = false

Expand Down
6 changes: 4 additions & 2 deletions Sources/ContainerClient/Utility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,10 @@ public struct Utility {
)
}

if Platform.current.architecture == "arm64" && requestedPlatform.architecture == "amd64" {
config.rosetta = true
config.rosetta = management.rosetta || (Platform.current.architecture == "arm64" && requestedPlatform.architecture == "amd64")

if management.rosetta && Platform.current.architecture != "arm64" {
throw ContainerizationError(.unsupported, message: "--rosetta flag requires an arm64 host")
}

config.labels = try Parser.labels(management.labels)
Expand Down