{"action":"created","issue":{"url":"https://api.github.com/repos/docker/machine/issues/1658","labels_url":"https://api.github.com/repos/docker/machine/issues/1658/labels{/name}","comments_url":"https://api.github.com/repos/docker/machine/issues/1658/comments","events_url":"https://api.github.com/repos/docker/machine/issues/1658/events","html_url":"https://github.com/docker/machine/pull/1658","id":99933968,"number":1658,"title":"Teach `env` to run a child process","user":{"login":"whilp","id":189851,"avatar_url":"https://avatars.githubusercontent.com/u/189851?v=3","gravatar_id":"","url":"https://api.github.com/users/whilp","html_url":"https://github.com/whilp","followers_url":"https://api.github.com/users/whilp/followers","following_url":"https://api.github.com/users/whilp/following{/other_user}","gists_url":"https://api.github.com/users/whilp/gists{/gist_id}","starred_url":"https://api.github.com/users/whilp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whilp/subscriptions","organizations_url":"https://api.github.com/users/whilp/orgs","repos_url":"https://api.github.com/users/whilp/repos","events_url":"https://api.github.com/users/whilp/events{/privacy}","received_events_url":"https://api.github.com/users/whilp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/machine/labels/status/2-code-review","name":"status/2-code-review","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-08-09T22:03:26Z","updated_at":"2015-08-11T21:07:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/machine/pulls/1658","html_url":"https://github.com/docker/machine/pull/1658","diff_url":"https://github.com/docker/machine/pull/1658.diff","patch_url":"https://github.com/docker/machine/pull/1658.patch"},"body":"Add support for running a child process in the `docker-machine` environment. This mirrors `ssh-agent`'s behavior when more than one argument is passed. For example:\n\n```\n$ env | grep SSH\n$ ssh-agent /usr/bin/env | grep SSH\nSSH_AUTH_SOCK=/tmp/ssh-ScOeqh91blLj/agent.70755\nSSH_AGENT_PID=70757\n$ env | grep SSH\n```\n\nSimilarly, one can now invoke a child process within `docker-machine env`:\n\n```\n$ ./machine env dev /usr/bin/env | grep DOCKER\nDOCKER_TLS_VERIFY=1\nDOCKER_HOST=tcp://192.168.99.101:2376\nDOCKER_CERT_PATH=/Users/whilp/.docker/machine/machines/dev\nDOCKER_MACHINE_NAME=dev\n$ /usr/bin/env | grep DOCKER\n```\n\nThis approach obviates the necessity for shell-specific export or unset syntax, so any shell (or, really, any program) is now supported. Previous behavior has been left in place."},"comment":{"url":"https://api.github.com/repos/docker/machine/issues/comments/130077800","html_url":"https://github.com/docker/machine/pull/1658#issuecomment-130077800","issue_url":"https://api.github.com/repos/docker/machine/issues/1658","id":130077800,"user":{"login":"whilp","id":189851,"avatar_url":"https://avatars.githubusercontent.com/u/189851?v=3","gravatar_id":"","url":"https://api.github.com/users/whilp","html_url":"https://github.com/whilp","followers_url":"https://api.github.com/users/whilp/followers","following_url":"https://api.github.com/users/whilp/following{/other_user}","gists_url":"https://api.github.com/users/whilp/gists{/gist_id}","starred_url":"https://api.github.com/users/whilp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whilp/subscriptions","organizations_url":"https://api.github.com/users/whilp/orgs","repos_url":"https://api.github.com/users/whilp/repos","events_url":"https://api.github.com/users/whilp/events{/privacy}","received_events_url":"https://api.github.com/users/whilp/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T21:07:07Z","updated_at":"2015-08-11T21:07:07Z","body":"@ehazlett hm -- that manual test case works for me:\r\n\r\n```shell\r\n$ echo $DOCKER_MACHINE_NAME\r\n\r\n$ docker-machine env -- dev /bin/sh -c 'echo $DOCKER_MACHINE_NAME'\r\ndev\r\n$ eval $(docker-machine env dev)\r\n$ echo $DOCKER_MACHINE_NAME\r\ndev\r\n```\r\n\r\n`dev` is a docker machine that was previously created. The error you pasted seems to be `ErrDetectionFailed`, which is returned by `DetectProvisioner()`. Is `test-vbox` a running machine? With this PR, I get the expected 'XXX is not running' or 'Host does not exist' errors with both the original shell and additional child behaviors."}}