13

I am trying to run a certain application in windows that uses docker. Since the application is a shell script, I use the cygwin terminal. As am new to docker, I dont have a clear Idea as to how it works.

Using boot2docker, I have a docker terminal open in windows 7 and a cygwin terminal to run the script.

But when I run the script, say

   ./xyz init

I get the following error

    trying to run docker resulted in exit code 127

Can you please tell me what are the basic first aid I should go through to resolve this?

The application is obtained from vision.ai, called vmx. The information about the application is here.

https://docs.vision.ai/

Your help is much appreciated.

Lakshmi Narayanan
  • 4,860
  • 13
  • 46
  • 86

6 Answers6

21

I got almost the same issue, the problem was simply in windows ending in that file, it was using CRLF instead of LF, change it to LF and it might work (using Notepad++, IntelliJ or Visual Code), referring to these answers:

env: bash\r: No such file or directory

How do I set all files in a subdirectory to use a specific eol using gitattributes?

So my .gitattributes file now is like this:

* text=auto
/docker/* text eol=lf
/ci/* text eol=lf
/sbt text eol=lf
/docker-*.sh text eol=lf
/sbt-dist/bin/*.bash text eol=lf
/sbt-dist/bin/sbt text eol=lf

These attributes because I have play framework project deployed in docker.

Al-Mothafar
  • 7,266
  • 6
  • 68
  • 96
1

I think the 127 means docker was not found on the path. Similar question. On windows docker will only work inside the boot2docker vm so if you are running the script in cygwin it would not work. You must ssh into the boot2docker vm and run your commands there.

Community
  • 1
  • 1
Usman Ismail
  • 17,055
  • 14
  • 78
  • 161
  • in my case i was trying to encapsulate the entire docker run command and arguments as a string. that was incorrect and did not work; I settled on using the argument terminator ` -- ` like so: `docker run ubuntu:trusty -- /usr/bin/command -a1 -b 2 argument3 argument4` – ThorSummoner Jan 04 '16 at 22:47
1

Make sure your file has the correct line ending.

For example, open your file using Vim and run: :set fileformat=unix, then save the file and run Docker again.

0leg
  • 11,884
  • 13
  • 63
  • 91
1

I faced the same error while building in AWS CodeBuild. The issue was the sudo in the commands

In the buildspec.yml file, I had to change:

sudo docker build -t xxxx:xxxx

to

docker build -t xxxx:xxxx
Suresh
  • 435
  • 4
  • 11
0

I would say Docker is not in your PATH. Add C:\Program Files\Docker\Docker\Resources\bin or appropriate

zhrist
  • 868
  • 7
  • 21
0

here are some resources for bulk/recursive line ending conversion that can sometimes be the cause of this issue: https://gist.github.com/search?q=dos2unix

Peter Kionga-Kamau
  • 5,671
  • 2
  • 12
  • 10