You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by tn...@apache.org on 2014/10/29 00:56:16 UTC

[4/8] git commit: Add priviledged option to docker info

Add priviledged option to docker info


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/45699c7c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/45699c7c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/45699c7c

Branch: refs/heads/docker_symlink
Commit: 45699c7c8e2eb7f61d19802d4752e58f5a7223ee
Parents: e4e3ef1
Author: Timothy Chen <tn...@apache.org>
Authored: Fri Oct 10 09:20:30 2014 -0700
Committer: Timothy Chen <tn...@gmail.com>
Committed: Tue Oct 28 23:02:37 2014 +0000

----------------------------------------------------------------------
 include/mesos/mesos.proto | 2 ++
 src/docker/docker.cpp     | 4 ++++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/45699c7c/include/mesos/mesos.proto
----------------------------------------------------------------------
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index 168a7a8..1d4f673 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -881,6 +881,8 @@ message ContainerInfo {
     }
 
     repeated PortMapping port_mappings = 3;
+
+    optional bool privileged = 4 [default = false];
   }
 
   required Type type = 1;

http://git-wip-us.apache.org/repos/asf/mesos/blob/45699c7c/src/docker/docker.cpp
----------------------------------------------------------------------
diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp
index d423d44..81d538a 100644
--- a/src/docker/docker.cpp
+++ b/src/docker/docker.cpp
@@ -293,6 +293,10 @@ Future<Nothing> Docker::run(
   argv.push_back("run");
   argv.push_back("-d");
 
+  if (dockerInfo.privileged()) {
+    argv.push_back("--privileged");
+  }
+
   if (resources.isSome()) {
     // TODO(yifan): Support other resources (e.g. disk).
     Option<double> cpus = resources.get().cpus();