rodrigocipriani encountered an error when trying to build the Discourse Docker image directly on Windows using docker-compose, receiving the message exec: "/bin/sh": stat /bin/sh: no such file or directory during the RUN bash /tmp/install-nginx step. After testing, they discovered that the issue stemmed from Windows line endings (CRLF) in the script file, which caused failures in the Linux-based Docker environment. The fix involved converting line endings with RUN sed 's/\r//g' /tmp/install-nginx > /tmp/install-nginx before execution rodrigocipriani. They questioned whether this was a bug or user error. Falco clarified that the official image is built on Linux via CI and intended to be used with the Discourse launcher script, not rebuilt locally. For Windows users wanting to deploy Discourse via docker-compose.yml alone, Falco advised using the launcher to build and push a custom image to a Docker registry, then referencing it in docker-compose.yml, pointing to this meta topic for more context. rodrigocipriani acknowledged the guidance and planned to proceed accordingly.
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!
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
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.
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.