# Error while running Docker code in Powershell

**URL:** <https://forums.docker.com/t/error-while-running-docker-code-in-powershell/34059>\
**Category:** Docker Desktop\
**Tags:** windows\
**Created:** [June 26, 2017, 5:35pm UTC](https://forums.docker.com/t/error-while-running-docker-code-in-powershell/34059 "2017-06-26T17:35:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sagar14](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sagar14](https://forums.docker.com/u/sagar14)\
**Post date:** [June 26, 2017, 5:35pm UTC](https://forums.docker.com/t/error-while-running-docker-code-in-powershell/34059/1 "2017-06-26T17:35:56Z")

</div>

Hi,

I’m using [this](https://cmusatyalab.github.io/openface/setup/) (Building a Docker Container) section. I could install the docker image and cd into “openface” folder. Now when I’m trying to run the command  
`./run-tests.sh`

I’m getting the following error:

> bash: ./run-tests.sh: /bin/bash^M: bad interpreter: No such file or directory

For this code:  
`./demos/compare.py images/examples/{lennon*,clapton*}`

I’m getting the error:

> : No such file or directory

But both the python code and the images exists in the respective folder.

Can anyone please tell me what can be the issue and how to resolve it?

Thank you!

---

<div class="post-metadata">

**Author:** ![funky81](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@funky81](https://forums.docker.com/u/funky81)\
**Post date:** [June 27, 2017, 8:56am UTC](https://forums.docker.com/t/error-while-running-docker-code-in-powershell/34059/2 "2017-06-27T08:56:15Z")

</div>

The container itself based on Linux? If yes, till now Windows Server cant use Linux Container.

---

<div class="post-metadata">

**Author:** ![sagar14](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sagar14](https://forums.docker.com/u/sagar14)\
**Post date:** [June 27, 2017, 9:11am UTC](https://forums.docker.com/t/error-while-running-docker-code-in-powershell/34059/3 "2017-06-27T09:11:10Z")

</div>

@funky81: Thanks for your reply! My server and container are both have linux. I downloaded docker and installed it in my windows 10 laptop. With this,as per my understanding, I’m getting linux container. Now I called the openface image file and installed it. Openface is a linux based image. Then I’m cd into openface folder and run these commands.

So I think I’m using both linux server as well as container. Please correct me if I’m wrong. I’m completely new in docker environment.

---

<div class="post-metadata">

**Author:** ![funky81](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@funky81](https://forums.docker.com/u/funky81)\
**Post date:** [June 27, 2017, 9:45am UTC](https://forums.docker.com/t/error-while-running-docker-code-in-powershell/34059/4 "2017-06-27T09:45:58Z")

</div>

You can use Linux Container in Docker for Windows 10 by switching to Linux VM in the docker control panel (docker taskbar). But fortunately you cant do this with Windows Server.

---

<div class="post-metadata">

**Author:** ![sagar14](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sagar14](https://forums.docker.com/u/sagar14)\
**Post date:** [June 27, 2017, 9:51am UTC](https://forums.docker.com/t/error-while-running-docker-code-in-powershell/34059/5 "2017-06-27T09:51:40Z")

</div>

@funky81: I’m using linux container only. Please find the screenshot attached. Please let me know if I’m missing something.

![](https://global.discourse-cdn.com/docker/original/3X/9/f/9fe438747c74a14d46fdb9b41d828d8bf84e4241.png)

---

<div class="post-metadata">

**Author:** ![jdharmon](https://avatars.discourse-cdn.com/v4/letter/j/76d3ee/32.png) [@jdharmon](https://forums.docker.com/u/jdharmon)\
**Post date:** [June 30, 2017, 11:07pm UTC](https://forums.docker.com/t/error-while-running-docker-code-in-powershell/34059/6 "2017-06-30T23:07:13Z")

</div>

The issue is Git converted line endings to Windows format, and now you have extra carriage returns (^M).

1. Configure Git not to convert line endings on checkout by running  
`git config --global core.autocrlf input`
2. Delete your local repository.
3. Clone it again.

For more info on how Git deals with line endings, see [Formatting and Whitespace](https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_formatting_and_whitespace)

---

<div class="post-metadata">

**Author:** ![sagar14](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sagar14](https://forums.docker.com/u/sagar14)\
**Post date:** [July 3, 2017, 5:21pm UTC](https://forums.docker.com/t/error-while-running-docker-code-in-powershell/34059/7 "2017-07-03T17:21:55Z")

</div>

@jdharmon: Thanks Jason! It worked.

---

<div class="post-metadata">

**Author:** ![tf888](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@tf888](https://forums.docker.com/u/tf888)\
**Post date:** [May 26, 2020, 8:38pm UTC](https://forums.docker.com/t/error-while-running-docker-code-in-powershell/34059/8 "2020-05-26T20:38:35Z")

</div>

I logged in only to say that this solution provided by **jdharmon** works like a charm in my case - Docker on Windows 10, project was originally built on Linux, default gitconfig

---

<div class="post-metadata">

**Author:** ![dougparnoff](https://avatars.discourse-cdn.com/v4/letter/d/b38774/32.png) [@dougparnoff](https://forums.docker.com/u/dougparnoff)\
**Post date:** [August 19, 2020, 9:56pm UTC](https://forums.docker.com/t/error-while-running-docker-code-in-powershell/34059/10 "2020-08-19T21:56:29Z")

</div>

> [@jdharmon](#):
>
> - Configure Git not to convert line endings on checkout by running  
> `git config --global core.autocrlf input`
> - Delete your local repository.
> - Clone it again.

Thank you so much!!  
I tried a lot of things but just this one worked!
