{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/23797793","id":23797793,"diff_hunk":"@@ -412,6 +395,106 @@ Docker supports softlinks for the Docker data directory\n     export DOCKER_TMPDIR=/mnt/disk2/tmp\n     /usr/local/bin/docker -d -D -g /var/lib/docker -H unix:// > /var/lib/boot2docker/docker.log 2>&1\n \n+## client\n+\n+There are several values you can use to configure _how_ the Docker client makes\n+requests to the Docker API endpoint and _which_ Docker API endpoint the client","path":"docs/sources/reference/commandline/cli.md","position":31,"original_position":31,"commit_id":"4d2129ed316be1459eee50b7fd88b1689d9f6a89","original_commit_id":"4d2129ed316be1459eee50b7fd88b1689d9f6a89","user":{"login":"fredlf","id":1459582,"avatar_url":"https://avatars.githubusercontent.com/u/1459582?v=3","gravatar_id":"","url":"https://api.github.com/users/fredlf","html_url":"https://github.com/fredlf","followers_url":"https://api.github.com/users/fredlf/followers","following_url":"https://api.github.com/users/fredlf/following{/other_user}","gists_url":"https://api.github.com/users/fredlf/gists{/gist_id}","starred_url":"https://api.github.com/users/fredlf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredlf/subscriptions","organizations_url":"https://api.github.com/users/fredlf/orgs","repos_url":"https://api.github.com/users/fredlf/repos","events_url":"https://api.github.com/users/fredlf/events{/privacy}","received_events_url":"https://api.github.com/users/fredlf/received_events","type":"User","site_admin":false},"body":"Should be \"a Docker API endpoint\"?","created_at":"2015-01-29T20:00:18Z","updated_at":"2015-01-29T20:00:18Z","html_url":"https://github.com/docker/docker/pull/10151#discussion_r23797793","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/10151","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/23797793"},"html":{"href":"https://github.com/docker/docker/pull/10151#discussion_r23797793"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/10151"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/10151","id":27549254,"html_url":"https://github.com/docker/docker/pull/10151","diff_url":"https://github.com/docker/docker/pull/10151.diff","patch_url":"https://github.com/docker/docker/pull/10151.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/10151","number":10151,"state":"open","locked":false,"title":"Allow specification of DOCKER_HOST, DOCKER_TLS_VERIFY, and DOCKER_CERT_PATH in a file","user":{"login":"nathanleclaire","id":1476820,"avatar_url":"https://avatars.githubusercontent.com/u/1476820?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanleclaire","html_url":"https://github.com/nathanleclaire","followers_url":"https://api.github.com/users/nathanleclaire/followers","following_url":"https://api.github.com/users/nathanleclaire/following{/other_user}","gists_url":"https://api.github.com/users/nathanleclaire/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanleclaire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanleclaire/subscriptions","organizations_url":"https://api.github.com/users/nathanleclaire/orgs","repos_url":"https://api.github.com/users/nathanleclaire/repos","events_url":"https://api.github.com/users/nathanleclaire/events{/privacy}","received_events_url":"https://api.github.com/users/nathanleclaire/received_events","type":"User","site_admin":false},"body":"## Abstract\r\n\r\nThis PR introduces a file, `defaults.json`, which can be used to specify values for which `DOCKER_HOST`, `DOCKER_TLS_VERIFY`, and `DOCKER_CERT_PATH` are used now.  This is similar to how you can save a `.aws/credentials` file with your keys in it in addition to putting them in environment variables.  \r\n\r\nTo be clear, this is in _addition_ to the current environment variables and flags, not in lieu of.\r\n\r\n## Motivation\r\n\r\nCurrently in [docker machine](https://github.com/docker/machine), when you create a shiny new Docker host `machine` will switch its state to point to that host as the \"active host\" (the host commands are meant to be run against).  However, processes cannot modify the environment variables of their parent processes, so `machine` has no way of automatically switching the host to run commands against from Docker's point of view.  The user must either run `export DOCKER_HOST=$(machine url) DOCKER_AUTH=identity` themselves (in the case of using `machine` with identity auth) or (in the case of TLS auth) execute commands in a fashion such as:\r\n\r\n```console\r\n$ docker $(machine config machine_name) ps \r\n```\r\n\r\nThis violates what I consider to be a principal of things which are well designed: ideally, users shouldn't have to notice or care about their presence at all (oft expressed in the cliche \"It Just Works\").  Either of these will be cumbersome to someone accustomed to what a typical Docker workflow looks like today, and it causes the state reported by `machine` and the actual state of the system to drift.\r\n\r\nAlso, if I'm not mistaken we could possibly use this to deprecate `$(boot2docker shellinit)` in the immediate future and lower the barrier to entry for users getting started with b2d further than it is now.  Not everyone is comfortable hacking their `.bashrc` and/or moving it around to all the computers they use and I'm not sure if an analogue to `.bashrc` exists on Windows so this would be helpful there). \r\n\r\nFinally, it could be used by 3rd party clients (perhaps with some sort of permissions model?) to do similar things to what `machine` and `boot2docker` would use it for.\r\n\r\n## Possible Issues\r\n\r\n- Lots of naming (e.g. `DefaultGetter`, `defaults.json`) and the general architecture / approach of the implementation could probably be improved to be more clear so I welcome feedback there.\r\n- I've tried my best to make sure pathing and e.g. assumptions about `~/.docker`'s location have been handled well but that kind of thing always gets tricky, so it's certainly an area to scrutinize.\r\n- Having so many places where these values could be changed could get confusing for users, which is why I've documented so thoroughly and included a warning to not edit `defaults.json` by hand if they don't know what they're dong.  In most cases the things that users will interact directly with will be flags, environment variables, or wrapper programs that edit `defaults.json`.\r\n- This touches a _very_ common code path and shouldn't be taken lightly, or accepted without thorough testing and review.\r\n- Calculating the value of `DOCKER_TLS_VERIFY` has changed slightly in this implementation from \"Empty string is false, anything else is true\" to \"truthy strings (1, true, T) are true, falsy strings (0, false, F, \"\") are false\".  Is this change acceptable?  I posit that it makes setting the value in `defaults.json` less error-prone for users, since `\"true\"` and \"true\" both work and are both valid JSON.\r\n\r\ncc @bfirsh @ehazlett PTAL with `machine` in mind, help on the code itself is welcome too of course.\r\ncc @SvenDowideit @fredlf @jamtur01 For docs review.  Do they look thorough and convey the intent well?\r\n\r\nSlightly influenced by #7232, but with pretty reduced scope.  I mostly care about setting default hosts and TLS settings.\r\n\r\nI will happily add tests if the ideas, design, and abstraction look good to the maintainers.  But first I wanted to get a rough draft together for everyone to look over and for people to play with if they wish.","created_at":"2015-01-17T01:27:37Z","updated_at":"2015-01-29T20:00:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4bfc872255bbf962af6d8f1eb912f26b47b278d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/10151/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/10151/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments/{number}","comments_url":"https://api.github.com/repos/docker/docker/issues/10151/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/4d2129ed316be1459eee50b7fd88b1689d9f6a89","head":{"label":"nathanleclaire:defaults","ref":"defaults","sha":"4d2129ed316be1459eee50b7fd88b1689d9f6a89","user":{"login":"nathanleclaire","id":1476820,"avatar_url":"https://avatars.githubusercontent.com/u/1476820?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanleclaire","html_url":"https://github.com/nathanleclaire","followers_url":"https://api.github.com/users/nathanleclaire/followers","following_url":"https://api.github.com/users/nathanleclaire/following{/other_user}","gists_url":"https://api.github.com/users/nathanleclaire/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanleclaire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanleclaire/subscriptions","organizations_url":"https://api.github.com/users/nathanleclaire/orgs","repos_url":"https://api.github.com/users/nathanleclaire/repos","events_url":"https://api.github.com/users/nathanleclaire/events{/privacy}","received_events_url":"https://api.github.com/users/nathanleclaire/received_events","type":"User","site_admin":false},"repo":{"id":19130382,"name":"docker","full_name":"nathanleclaire/docker","owner":{"login":"nathanleclaire","id":1476820,"avatar_url":"https://avatars.githubusercontent.com/u/1476820?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanleclaire","html_url":"https://github.com/nathanleclaire","followers_url":"https://api.github.com/users/nathanleclaire/followers","following_url":"https://api.github.com/users/nathanleclaire/following{/other_user}","gists_url":"https://api.github.com/users/nathanleclaire/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanleclaire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanleclaire/subscriptions","organizations_url":"https://api.github.com/users/nathanleclaire/orgs","repos_url":"https://api.github.com/users/nathanleclaire/repos","events_url":"https://api.github.com/users/nathanleclaire/events{/privacy}","received_events_url":"https://api.github.com/users/nathanleclaire/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nathanleclaire/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/nathanleclaire/docker","forks_url":"https://api.github.com/repos/nathanleclaire/docker/forks","keys_url":"https://api.github.com/repos/nathanleclaire/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nathanleclaire/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nathanleclaire/docker/teams","hooks_url":"https://api.github.com/repos/nathanleclaire/docker/hooks","issue_events_url":"https://api.github.com/repos/nathanleclaire/docker/issues/events{/number}","events_url":"https://api.github.com/repos/nathanleclaire/docker/events","assignees_url":"https://api.github.com/repos/nathanleclaire/docker/assignees{/user}","branches_url":"https://api.github.com/repos/nathanleclaire/docker/branches{/branch}","tags_url":"https://api.github.com/repos/nathanleclaire/docker/tags","blobs_url":"https://api.github.com/repos/nathanleclaire/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nathanleclaire/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nathanleclaire/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/nathanleclaire/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nathanleclaire/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/nathanleclaire/docker/languages","stargazers_url":"https://api.github.com/repos/nathanleclaire/docker/stargazers","contributors_url":"https://api.github.com/repos/nathanleclaire/docker/contributors","subscribers_url":"https://api.github.com/repos/nathanleclaire/docker/subscribers","subscription_url":"https://api.github.com/repos/nathanleclaire/docker/subscription","commits_url":"https://api.github.com/repos/nathanleclaire/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/nathanleclaire/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/nathanleclaire/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/nathanleclaire/docker/issues/comments/{number}","contents_url":"https://api.github.com/repos/nathanleclaire/docker/contents/{+path}","compare_url":"https://api.github.com/repos/nathanleclaire/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nathanleclaire/docker/merges","archive_url":"https://api.github.com/repos/nathanleclaire/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nathanleclaire/docker/downloads","issues_url":"https://api.github.com/repos/nathanleclaire/docker/issues{/number}","pulls_url":"https://api.github.com/repos/nathanleclaire/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/nathanleclaire/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/nathanleclaire/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nathanleclaire/docker/labels{/name}","releases_url":"https://api.github.com/repos/nathanleclaire/docker/releases{/id}","created_at":"2014-04-25T01:45:00Z","updated_at":"2015-01-12T19:23:24Z","pushed_at":"2015-01-20T02:51:37Z","git_url":"git://github.com/nathanleclaire/docker.git","ssh_url":"git@github.com:nathanleclaire/docker.git","clone_url":"https://github.com/nathanleclaire/docker.git","svn_url":"https://github.com/nathanleclaire/docker","homepage":"http://www.docker.io","size":41651,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"4c38045be1deed08bc1494261fd9a3e2812e67ad","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments/{number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","created_at":"2013-01-18T18:10:57Z","updated_at":"2015-01-29T19:46:14Z","pushed_at":"2015-01-29T18:23:57Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":131326,"stargazers_count":18780,"watchers_count":18780,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3871,"mirror_url":null,"open_issues_count":993,"forks":3871,"open_issues":993,"watchers":18780,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/10151"},"html":{"href":"https://github.com/docker/docker/pull/10151"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/10151"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/10151/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/10151/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/10151/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/4d2129ed316be1459eee50b7fd88b1689d9f6a89"}}}}