简体   繁体   中英

bash syntax error while running docker command

I was getting an error while running the docker ps command which is -

> An error occurred trying to connect: Get
> http://localhost:2375/v1.21/containers/json?all=1: dial tcp
> 127.0.0.1:2375: ConnectEx tcp: No connection could be made because the target machine actively refused it.

I was trying to correct the error using the instruction present in this forum - https://forums.docker.com/t/windows-an-error-occurred-trying-to-connect/4384

I am facing an error in the last step ie running this command in git bash -

FOR /f "tokens=*" %i IN ('"C:\Program Files\Docker Toolbox\docker-machine.exe" env --shell cmd machinename') DO %i

The error which I get is

bash: syntax error near unexpected token `('

Any help to solve this issue? I tried to escape the single and double quotes and that didn't work.

I am facing an error in the last step ie running this command in git bash -

 FOR /f "tokens=*" %i IN ('"C:\\Program Files\\Docker Toolbox\\docker-machine.exe" env --shell cmd machinename') DO %i 

This is batch syntax, in bash this should work:

eval `docker-machine env`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM