MCPcopy Create free account
hub / github.com/apache/mesos / launchContainer

Method launchContainer

src/tests/environment.cpp:374–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372private:
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 {

Callers

nothing calls this directly

Calls 7

FailureClass · 0.85
NothingClass · 0.85
runMethod · 0.65
stringifyFunction · 0.50
thenMethod · 0.45
isSomeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected