DOCKER for Windows - Open cmd executing docker mac

2019-09-05 01:49发布

I'm using Docker For Windows ( not Dokcer toolbox ) and it is running with HyperV.

So, every time I open a new CMD, I need to run "docker-machine env" and define variables for shell following the command response :

REM Run this command to configure your shell:
REM     @FOR /f "tokens=*" %i IN ('docker-machine env') DO @%i

Could i create a shortcut for open CMD executing this commands.

Obs. I wouldn´t like to install a plugin or app for better command shell..

If anybody has a suggestions, Thanks! :)

2条回答
三岁会撩人
2楼-- · 2019-09-05 02:09

Also, in my case I need to start in a specific folder.

Putting the command bellow in "Shorcut Properties > target" works perfectly for me :

%windir%\system32\cmd.exe /K "cd c:\docker & docker-machine env & @FOR /f "tokens=*" %i IN ('docker-machine env') DO @%i"

查看更多
Root(大扎)
3楼-- · 2019-09-05 02:18

I'm not exactly certain I understand your question. It hasn't been my experience that need to do anything special when I open a command prompt. The docker commands are available "out of the box".

查看更多
登录 后发表回答