You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/07/13 17:08:13 UTC

mesos git commit: Added private registry with auth document and fixed correspondings.

Repository: mesos
Updated Branches:
  refs/heads/master c40e48897 -> 36717c92c


Added private registry with auth document and fixed correspondings.

Review: https://reviews.apache.org/r/49960/


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

Branch: refs/heads/master
Commit: 36717c92ccac7a89f6d29004bf873c28fcde71a2
Parents: c40e488
Author: Gilbert Song <so...@gmail.com>
Authored: Wed Jul 13 09:34:44 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Jul 13 10:08:06 2016 -0700

----------------------------------------------------------------------
 docs/configuration.md        | 12 +++++------
 docs/container-image.md      | 45 +++++++++++++++++++++++++++++++++------
 docs/docker-containerizer.md |  9 ++++----
 src/slave/flags.cpp          |  8 +++----
 4 files changed, 54 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/36717c92/docs/configuration.md
----------------------------------------------------------------------
diff --git a/docs/configuration.md b/docs/configuration.md
index 68bd4d3..de211ca 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -1256,12 +1256,12 @@ containerizer.
     --docker_config=VALUE
   </td>
   <td>
-The default docker config file for agent. Can be provided either as a
-path pointing to the agent local docker config file, or as a JSON-formatted
-string. The format of the docker config file should be identical to docker's
-default one (e.g., either <code>~/.docker/config.json</code> or
-<code>~/.dockercfg</code>).
-Example JSON (<code>~/.docker/config.json</code>):
+The default docker config file for agent. Can be provided either as an
+absolute path pointing to the agent local docker config file, or as a
+JSON-formatted string. The format of the docker config file should be
+identical to docker's default one (e.g., either
+<code>$HOME/.docker/config.json</code> or <code>$HOME/.dockercfg</code>).
+Example JSON (<code>$HOME/.docker/config.json</code>):
 <pre><code>{
   "auths": {
     "https://index.docker.io/v1/": {

http://git-wip-us.apache.org/repos/asf/mesos/blob/36717c92/docs/container-image.md
----------------------------------------------------------------------
diff --git a/docs/container-image.md b/docs/container-image.md
index 6d180e4..745f6b0 100644
--- a/docs/container-image.md
+++ b/docs/container-image.md
@@ -183,12 +183,39 @@ API](https://docs.docker.com/registry/spec/api/) to fetch Docker
 images/layers. The fetching is based on `curl`, therefore SSL is
 automatically handled. For private registries, the operator needs to
 configure `curl` accordingly so that it knows where to find the
-additional certificate files. Fetching requiring authentication is
-currently not supported yet (coming soon).
-
-Private registry is supported through the `--docker_registry` agent
-flag. Specifying private registry for each container using
-`Image.Docker.name` is not supported yet (coming soon).
+additional certificate files.
+
+Fetching requiring authentication is supported through the
+`--docker_config` agent flag. Starting from 1.0, operators can use
+this agent flag to specify a shared docker config file, which is
+used for pulling private repositories with authentication. Per
+container credential is not supported yet (coming soon).
+
+Operators can either specify the flag as an absolute path pointing to
+the docker config file (need to manually configure
+`.docker/config.json` or `.dockercfg` on each agent), or specify the
+flag as a JSON-formatted string. See [configuration
+documentation](configuration.md) for detail. For example:
+
+    --docker_config=file:///home/vagrant/.docker/config.json
+
+or as a JSON object,
+
+    --docker_config="{ \
+      \"auths\": { \
+        \"https://index.docker.io/v1/\": { \
+          \"auth\": \"xXxXxXxXxXx=\", \
+          \"email\": \"username@example.com\" \
+        } \
+      } \
+    }"
+
+Private registry is supported either through the `--docker_registry`
+agent flag, or specifying private registry for each container using
+image name `<REGISTRY>/<REPOSITORY>` (e.g.,
+`localhost:80/gilbert/inky:latest`). If `<REGISTRY>` is included as
+a prefix in the image name, the registry specified through the agent
+flag `--docker_registry` will be ignored.
 
 If the `--docker_registry` agent flag points to a local directory
 (e.g., `/tmp/mesos/images/docker`), the provisioner will pull Docker
@@ -224,6 +251,12 @@ could either be a Docker registry server URL (i.e:
 images in. All the Docker images are cached under this directory. The
 default value is `/tmp/mesos/store/docker`.
 
+`--docker_config`: The default docker config file for agent. Can
+be provided either as an absolute path pointing to the agent local
+docker config file, or as a JSON-formatted string. The format of
+the docker config file should be identical to docker's default one
+(e.g., either `$HOME/.docker/config.json` or `$HOME/.dockercfg`).
+
 
 ## Appc Support and Current Limitations
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/36717c92/docs/docker-containerizer.md
----------------------------------------------------------------------
diff --git a/docs/docker-containerizer.md b/docs/docker-containerizer.md
index 7a7cb95..1750b06 100644
--- a/docs/docker-containerizer.md
+++ b/docs/docker-containerizer.md
@@ -102,10 +102,11 @@ config file for pulling images from private registries. We allow
 operators to specify a shared docker config file using an agent flag.
 This docker config file will be used to pull images from private
 registries for all containers. See [configuration
-documentation](configuration.md) for detail. Operators can either use
-a local docker config file (need to manually configure
-.docker/config.json or .dockercfg on each agent), or specify the flag
-as a JSON-formatted string. For example:
+documentation](configuration.md) for detail. Operators can either
+specify the flag as an absolute path pointing to the docker config
+file (need to manually configure `.docker/config.json` or `.dockercfg`
+on each agent), or specify the flag as a JSON-formatted string.  For
+example:
 
     --docker_config=file:///home/vagrant/.docker/config.json
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/36717c92/src/slave/flags.cpp
----------------------------------------------------------------------
diff --git a/src/slave/flags.cpp b/src/slave/flags.cpp
index 84dbb2d..166a651 100644
--- a/src/slave/flags.cpp
+++ b/src/slave/flags.cpp
@@ -556,12 +556,12 @@ mesos::internal::slave::Flags::Flags()
 
   add(&Flags::docker_config,
       "docker_config",
-      "The default docker config file for agent. Can be provided either as a\n"
-      "path pointing to the agent local docker config file, or as a\n"
+      "The default docker config file for agent. Can be provided either as an\n"
+      "absolute path pointing to the agent local docker config file, or as a\n"
       "JSON-formatted string. The format of the docker config file should be\n"
       "identical to docker's default one (e.g., either\n"
-      "`~/.docker/config.json` or `~/.dockercfg`).\n"
-      "Example JSON (`~/.docker/config.json`):\n"
+      "`$HOME/.docker/config.json` or `$HOME/.dockercfg`).\n"
+      "Example JSON (`$HOME/.docker/config.json`):\n"
       "{\n"
       "  \"auths\": {\n"
       "    \"https://index.docker.io/v1/\": {\n"