| 372 | private: |
| 373 | #ifdef __WINDOWS__ |
| 374 | Future<Nothing> launchContainer( |
| 375 | const Owned<Docker>& docker, |
| 376 | const string& containerName, |
| 377 | const string& networkName, |
| 378 | const string& imageName) |
| 379 | { |
| 380 | Docker::RunOptions opts; |
| 381 | opts.privileged = false; |
| 382 | opts.name = containerName; |
| 383 | opts.network = networkName; |
| 384 | opts.additionalOptions = {"-d", "--rm"}; |
| 385 | opts.image = imageName; |
| 386 | opts.arguments = {"ping", "-n", "60", "127.0.0.1"}; |
| 387 | |
| 388 | // Launches the container in detached mode, which means that docker |
| 389 | // run should return as soon as the container successfully launched. |
| 390 | return docker->run(opts, process::Subprocess::PATH(os::DEV_NULL)) |
| 391 | .then([=](const Option<int>& status) -> Future<Nothing> { |
| 392 | if (!status.isSome()) { |
| 393 | return Failure( |
| 394 | "Container " + containerName + " failed with unknown exit code"); |
| 395 | } |
| 396 | |
| 397 | if (status.get() != 0) { |
| 398 | return Failure( |
| 399 | "Container " + containerName + " returned exit code " + |
| 400 | stringify(status.get())); |
| 401 | } |
| 402 | |
| 403 | return Nothing(); |
| 404 | }); |
| 405 | } |
| 406 | |
| 407 | Option<Error> runNetNamespaceCheck(const Owned<Docker>& docker) |
| 408 | { |