srishti
srishti

Reputation: 117

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 i.e. 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.

Upvotes: 2

Views: 1512

Answers (1)

tkausl
tkausl

Reputation: 14269

I am facing an error in the last step i.e. 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`

Upvotes: 1

Related Questions