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
12 changes: 2 additions & 10 deletions Sources/Mocker/Commands/Compose.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1054,21 +1054,13 @@ struct ComposeRun: AsyncParsableCommand {
environment[String(parts[0])] = String(parts[1])
}

// Docker treats `--entrypoint` as shell form: it is split on spaces, the
// first token overrides the executable and any remaining tokens lead the
// command argv. Apple's `container` CLI only accepts a single token here.
let exec = ComposeOrchestrator.resolveExec(
entrypoint: entrypoint?.split(separator: " ").map(String.init) ?? [],
command: command
)

let containerConfig = ContainerConfig(
image: image,
command: exec.command,
command: command,
environment: environment,
detach: detach,
workingDir: workdir,
entrypoint: exec.entrypoint
entrypoint: entrypoint
)

let container = try await engine.run(containerConfig)
Expand Down
12 changes: 2 additions & 10 deletions Sources/Mocker/Commands/Create.swift
Original file line number Diff line number Diff line change
Expand Up @@ -348,18 +348,10 @@ struct Create: AsyncParsableCommand {

let restartPolicy = RestartPolicy(rawValue: restart) ?? .no

// Docker treats `--entrypoint` as shell form: it is split on spaces, the
// first token overrides the executable and any remaining tokens lead the
// command argv. Apple's `container` CLI only accepts a single token here.
let exec = ComposeOrchestrator.resolveExec(
entrypoint: entrypoint?.split(separator: " ").map(String.init) ?? [],
command: command
)

let containerConfig = ContainerConfig(
name: name,
image: image,
command: exec.command,
command: command,
environment: environment,
ports: ports,
volumes: volumes,
Expand All @@ -372,7 +364,7 @@ struct Create: AsyncParsableCommand {
hostname: hostname,
restartPolicy: restartPolicy,
user: user,
entrypoint: exec.entrypoint,
entrypoint: entrypoint,
platform: platform,
virtualization: virtualization,
kernel: kernel,
Expand Down
12 changes: 2 additions & 10 deletions Sources/Mocker/Commands/Run.swift
Original file line number Diff line number Diff line change
Expand Up @@ -396,18 +396,10 @@ struct Run: AsyncParsableCommand {

let restartPolicy = RestartPolicy(rawValue: restart) ?? .no

// Docker treats `--entrypoint` as shell form: it is split on spaces, the
// first token overrides the executable and any remaining tokens lead the
// command argv. Apple's `container` CLI only accepts a single token here.
let exec = ComposeOrchestrator.resolveExec(
entrypoint: entrypoint?.split(separator: " ").map(String.init) ?? [],
command: command
)

let containerConfig = ContainerConfig(
name: name,
image: image,
command: exec.command,
command: command,
environment: environment,
ports: ports,
volumes: volumes,
Expand All @@ -420,7 +412,7 @@ struct Run: AsyncParsableCommand {
hostname: hostname,
restartPolicy: restartPolicy,
user: user,
entrypoint: exec.entrypoint,
entrypoint: entrypoint,
platform: platform,
virtualization: virtualization,
kernel: kernel,
Expand Down
Loading