Fail to run directly docker-compose from /discourse-docker/image/base on Windows in Virtual Machine

When I ran:

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

I got this message:

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

On this step of Dockerfile:

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:

RUN bash /tmp/install-nginx

And it works! :thinking:

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:

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

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

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

Before this:

RUN /tmp/install-nginx

Everything works fine! :laughing: . 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? :thinking:

1 Like

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?

4 Likes

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.

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?

3 Likes

I’ll try it. Thanks.

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