# Falha ao executar docker-compose diretamente de /discourse-docker/image/base no Windows em Máquina Virtual

**URL:** https://meta.discourse.org/t/fail-to-run-directly-docker-compose-from-discourse-docker-image-base-on-windows-in-virtual-machine/99443
**Category:** Self-hosting
**Created:** [13 Outubro , 2018 19:11 UTC](https://meta.discourse.org/t/fail-to-run-directly-docker-compose-from-discourse-docker-image-base-on-windows-in-virtual-machine/99443 "2018-10-13T19:11:45Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![rodrigocipriani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rodrigocipriani/32/119477_2.png) [@rodrigocipriani](https://meta.discourse.org/u/rodrigocipriani)
#### Post date: [13 Outubro , 2018 19:11 UTC](https://meta.discourse.org/t/fail-to-run-directly-docker-compose-from-discourse-docker-image-base-on-windows-in-virtual-machine/99443/1 "2018-10-13T19:11:45Z")

</div>

When I ran:

```plaintext
git clone https://github.com/discourse/discourse_docker.git discourse
cd discourse/image/base
docker-compose build -t discourse .

```

I got this message:

```plaintext
exec: "/bin/sh": stat /bin/sh: no such file or directory

```

On this step of Dockerfile:

```plaintext
RUN bash /tmp/install-nginx

```

When I add `RUN ls -la /tmp` before this step, I can confirm that this file exists.

After a lot of tries, I’ve tried this:

```plaintext
RUN bash /tmp/install-nginx

```

And it works! 🤔

It is do easy to fix and PR, but I think that may be something I did.

**What do you think?** Is it a bug, or my mistake?

Info:

```plaintext
Windows 10

docker --version
Docker version 18.02.0-ce, build fc4de447b5

docker-compose --version
docker-compose version 1.19.0, build 9e633ef3

git clone was did today 
October, 13 of 2018

```

---

<div class="post-metadata">

### Author: ![rodrigocipriani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rodrigocipriani/32/119477_2.png) [@rodrigocipriani](https://meta.discourse.org/u/rodrigocipriani)
#### Post date: [13 Outubro , 2018 21:48 UTC](https://meta.discourse.org/t/fail-to-run-directly-docker-compose-from-discourse-docker-image-base-on-windows-in-virtual-machine/99443/2 "2018-10-13T21:48:22Z")

</div>

While I was doing a looot of tests, I figured out that if I add this:

```plaintext
RUN sed 's/\r//g' /tmp/install-nginx > /tmp/install-nginx

```

Before this:

```plaintext
RUN /tmp/install-nginx

```

Everything works fine! 😆 . I think problem is breaklines in Windows are different from Linux, and it was causing the problem.

Ps.:  
When I said that work well with this `RUN bash /tmp/install-nginx` was my mistake, because this step was failed.

But the question continues… Is it a bug, or still it my mistake? 🤔

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [14 Outubro , 2018 05:15 UTC](https://meta.discourse.org/t/fail-to-run-directly-docker-compose-from-discourse-docker-image-base-on-windows-in-virtual-machine/99443/3 "2018-10-14T05:15:56Z")

</div>

This image is built by our CI server (check the autobuild script) and the result is pushed weekly to the Docker Hub. This is done in a standard Linux server, and people are supposed to use the resulting image with our launcher script, instead of rebuilding it locally.

That said, we are not keen in adding any unneeded complexity to the process if the trade-off isn’t worth it.

Can you explain more about what is your end goal?

---

<div class="post-metadata">

### Author: ![rodrigocipriani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rodrigocipriani/32/119477_2.png) [@rodrigocipriani](https://meta.discourse.org/u/rodrigocipriani)
#### Post date: [14 Outubro , 2018 15:06 UTC](https://meta.discourse.org/t/fail-to-run-directly-docker-compose-from-discourse-docker-image-base-on-windows-in-virtual-machine/99443/4 "2018-10-14T15:06:47Z")

</div>

Thanks for answering. I understood what you’ve said.  
So, my end goal is install Discourse only with docker-compose.yml. Not needed to run any script before, and, on Windows too.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [14 Outubro , 2018 15:58 UTC](https://meta.discourse.org/t/fail-to-run-directly-docker-compose-from-discourse-docker-image-base-on-windows-in-virtual-machine/99443/5 "2018-10-14T15:58:09Z")

</div>

You will need to use launcher, push the resulting image to a Docker registry, and then use this image in the docker compose.

You can read more about this in [Can Discourse ship frequent Docker images that do not need to be bootstrapped?](https://meta.discourse.org/t/can-discourse-ship-frequent-docker-images-that-do-not-need-to-be-bootstrapped/33205)

---

<div class="post-metadata">

### Author: ![rodrigocipriani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rodrigocipriani/32/119477_2.png) [@rodrigocipriani](https://meta.discourse.org/u/rodrigocipriani)
#### Post date: [15 Outubro , 2018 12:57 UTC](https://meta.discourse.org/t/fail-to-run-directly-docker-compose-from-discourse-docker-image-base-on-windows-in-virtual-machine/99443/6 "2018-10-15T12:57:13Z")

</div>

I’ll try it. Thanks.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [14 Novembro , 2018 13:02 UTC](https://meta.discourse.org/t/fail-to-run-directly-docker-compose-from-discourse-docker-image-base-on-windows-in-virtual-machine/99443/7 "2018-11-14T13:02:58Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
