{"action":"created","issue":{"url":"https://api.github.com/repos/docker/machine/issues/777","labels_url":"https://api.github.com/repos/docker/machine/issues/777/labels{/name}","comments_url":"https://api.github.com/repos/docker/machine/issues/777/comments","events_url":"https://api.github.com/repos/docker/machine/issues/777/events","html_url":"https://github.com/docker/machine/pull/777","id":60953008,"number":777,"title":"Use DOCKER_HOST for active host instead of 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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/docker/machine/milestones/3","html_url":"https://github.com/docker/machine/milestones/0.3.0","labels_url":"https://api.github.com/repos/docker/machine/milestones/3/labels","id":1043374,"number":3,"title":"0.3.0","description":"","creator":{"login":"ehazlett","id":260642,"avatar_url":"https://avatars.githubusercontent.com/u/260642?v=3","gravatar_id":"","url":"https://api.github.com/users/ehazlett","html_url":"https://github.com/ehazlett","followers_url":"https://api.github.com/users/ehazlett/followers","following_url":"https://api.github.com/users/ehazlett/following{/other_user}","gists_url":"https://api.github.com/users/ehazlett/gists{/gist_id}","starred_url":"https://api.github.com/users/ehazlett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehazlett/subscriptions","organizations_url":"https://api.github.com/users/ehazlett/orgs","repos_url":"https://api.github.com/users/ehazlett/repos","events_url":"https://api.github.com/users/ehazlett/events{/privacy}","received_events_url":"https://api.github.com/users/ehazlett/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":11,"state":"open","created_at":"2015-03-29T04:34:35Z","updated_at":"2015-05-01T20:11:31Z","due_on":"2015-06-02T04:00:00Z","closed_at":null},"comments":26,"created_at":"2015-03-13T01:16:50Z","updated_at":"2015-05-02T21:33:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/machine/pulls/777","html_url":"https://github.com/docker/machine/pull/777","diff_url":"https://github.com/docker/machine/pull/777.diff","patch_url":"https://github.com/docker/machine/pull/777.patch"},"body":"This method of tracking the \"active\" host for machine simply checks which machine is set in `DOCKER_HOST`.\r\n\r\nIf `DOCKER_HOST` is set to point to an address which is registered with `docker-machine`, the `*` will appear next to the respective machine.\r\n\r\nThis means that:\r\n\r\n![screen shot 2015-03-12 at 5 07 03 pm](https://cloud.githubusercontent.com/assets/1476820/6631435/8dbae88c-c8e3-11e4-984e-cd5babc4916a.png)\r\n\r\n_It Just Works_\r\n\r\nInterestingly, this implementation prevents the kinds of issues where users attempt to run commands against the active host when there isn't one, since it will simply error out if a user attempts a command of this style instead of trying to go forward (and probably panicing).\r\n\r\n## Concerns\r\n\r\n- `docker-machine stop` (without arguments, thereby indicating the active host) works out of the box with this method, because it recognizes the active host as the one to stop, but `docker-machine start` does not work with some drivers such as VBox which expect the machine to be up in order to retrieve the IP address.  It forces specificity in this case.\r\n- This causes an additional call to `GetURL` per-goroutine in `ls` (since each goroutine calls to check if it is the active host), which may have (probably minor) performance implications for drivers which actually perform remote operations to get the URL such as VBox.  Most, AFAICT, just grab the \"cached\" value if it is around (they shouldn't, really; it might change- but that's for another PR).\r\n- I couldn't really figure out how to integration test this (perhaps my own shortcoming, but I am not sure if `bats` messes with environment variables in unexpected ways), and may have missed removing some of those tests, so PTAL.\r\n\r\nprops to @tiborvass for the idea\r\n\r\ncc @ehazlett @bfirsh @sthulb "},"comment":{"url":"https://api.github.com/repos/docker/machine/issues/comments/98405656","html_url":"https://github.com/docker/machine/pull/777#issuecomment-98405656","issue_url":"https://api.github.com/repos/docker/machine/issues/777","id":98405656,"user":{"login":"tiborvass","id":827131,"avatar_url":"https://avatars.githubusercontent.com/u/827131?v=3","gravatar_id":"","url":"https://api.github.com/users/tiborvass","html_url":"https://github.com/tiborvass","followers_url":"https://api.github.com/users/tiborvass/followers","following_url":"https://api.github.com/users/tiborvass/following{/other_user}","gists_url":"https://api.github.com/users/tiborvass/gists{/gist_id}","starred_url":"https://api.github.com/users/tiborvass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiborvass/subscriptions","organizations_url":"https://api.github.com/users/tiborvass/orgs","repos_url":"https://api.github.com/users/tiborvass/repos","events_url":"https://api.github.com/users/tiborvass/events{/privacy}","received_events_url":"https://api.github.com/users/tiborvass/received_events","type":"User","site_admin":false},"created_at":"2015-05-02T21:33:24Z","updated_at":"2015-05-02T21:33:24Z","body":"@nathanleclaire does this include `docker-machine env` as well ?\r\n\r\nIf you remove the short form, then what's the purpose of this PR ? What can DOCKER_HOST be used for?"}}