Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eval command not found when completing the Docker for Windows tutorial

Tags:

docker

Eval command does not exist in Windows.
The Docker for Windows tutorial step 6 says to run this command:

C:\Users\mary> eval "$(docker-machine env my-default)"

Is this a mistake in the tutorial or did I not install something correctly?
I can run this command just fine from Git Bash but I'm curious why the Docker tutorial says to run this command from the Windows command prompt.

Here is the link to the tutorial https://docs.docker.com/v1.8/installation/windows/#using-docker-from-windows-command-line-prompt-cmd-exe

like image 645
Brett Mathe Avatar asked Dec 03 '15 01:12

Brett Mathe


3 Answers

You can only run it from a bash indeed.
(like the git bash: C:\path\to\PortableGit-2.6.3-64-bit\git-bash.exe)

Or you can run it from a regular CMD, without the eval:

docker-machine env my-default
like image 184
VonC Avatar answered Nov 01 '22 15:11

VonC


Run below commands to configure your shell/cmd terminal

docker-machine env --shell cmd my-default

FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd my-default') DO %i

After successfully running the above commands you can run any docker command from the shell/cmd terminal.

like image 4
Dhrubo Avatar answered Nov 01 '22 16:11

Dhrubo


I use the cmder console emulator. For the most part, I followed the docker docs for setting up from the windows 10 command prompt, except for the eval statement. When I attempted to run the eval statement described in the docs, I was prompted to run a different command instead (below), and it successfully activated my machine. MYMACHINEHERE should be the name of the machine you will have already created in an earlier step.

@FOR /f "tokens=*" %i IN ('docker-machine env MYMACHINEHERE') DO @%i
like image 1
vaer-k Avatar answered Nov 01 '22 16:11

vaer-k