Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Commit

Permalink
Merge pull request #795 from tianon/eval-env
Browse files Browse the repository at this point in the history
Add "eval" to every invocation of "docker-machine env"
  • Loading branch information
ehazlett committed Mar 17, 2015
2 parents cb7a488 + d6e3dd6 commit 89ea1ed
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ INFO[0000] Creating VirtualBox VM...
INFO[0007] Starting VirtualBox VM...
INFO[0007] Waiting for VM to start...
INFO[0041] "dev" has been created and is now the active machine.
INFO[0041] To point your Docker client at it, run this in your shell: $(docker-machine env dev)
INFO[0041] To point your Docker client at it, run this in your shell: eval "$(docker-machine env dev)"

$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM
dev * virtualbox Running tcp://192.168.99.127:2376

$ $(docker-machine env dev)
$ eval "$(docker-machine env dev)"

$ docker run busybox echo hello world
Unable to find image 'busybox:latest' locally
Expand All @@ -35,7 +35,7 @@ INFO[0001] Creating Digital Ocean droplet...
INFO[0002] Waiting for SSH...
INFO[0070] Configuring Machine...
INFO[0109] "staging" has been created and is now the active machine.
INFO[0109] To point your Docker client at it, run this in your shell: $(docker-machine env staging)
INFO[0109] To point your Docker client at it, run this in your shell: eval "$(docker-machine env staging)"

$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM
Expand Down
2 changes: 1 addition & 1 deletion commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func cmdCreate(c *cli.Context) {
case "fish":
info = fmt.Sprintf("%s env %s | source", c.App.Name, name)
default:
info = fmt.Sprintf("$(%s env %s)", c.App.Name, name)
info = fmt.Sprintf(`eval "$(%s env %s)"`, c.App.Name, name)
}

log.Infof("%q has been created and is now the active machine.", name)
Expand Down
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ $ docker-machine create -d virtualbox local
Load the Machine configuration into your shell:

```
$ $(docker-machine env local)
$ eval "$(docker-machine env local)"
```
Then run generate the token using the Swarm Docker image:

Expand Down Expand Up @@ -324,7 +324,7 @@ export DOCKER_HOST=tcp://192.168.99.100:3376
```

You can load this into your environment using
`$(docker-machine env --swarm swarm-master)`.
`eval "$(docker-machine env --swarm swarm-master)"`.

Now you can use the Docker CLI to query:

Expand Down Expand Up @@ -389,13 +389,13 @@ run in a subshell. Running `docker-machine env -u` will print

```
$ env | grep DOCKER
$ $(docker-machine env dev)
$ eval "$(docker-machine env dev)"
$ env | grep DOCKER
DOCKER_HOST=tcp://192.168.99.101:2376
DOCKER_CERT_PATH=/Users/nathanleclaire/.docker/machines/.client
DOCKER_TLS_VERIFY=1
$ # If you run a docker command, now it will run against that host.
$ $(docker-machine env -u)
$ eval "$(docker-machine env -u)"
$ env | grep DOCKER
$ # The environment variables have been unset.
```
Expand Down

0 comments on commit 89ea1ed

Please sign in to comment.