When I then pull the repository from GitHub build it on my windows machine (no changes to dockerfile, no errors while building) push it to docker hub and then pull it from there on my server (identical docker-compose just “my” image instead of the “original” one) it gives me /usr/local/bin/docker-php-entrypoint: exec: line 9: /data/bin/start.sh: not found.
Any ideas what goes wrong?
I also tried to up the osticket version in the docker file - of course with the exact same error (posted here now answer yet).
It happens when you pull a git project on windows with settings to convert line endings in shell scripts beginning with the shebang line.
The error message in this case doesn’t say that the start.sh does not exist. It actually tries to run it but the shebang line tells the shell which program should execute the content when you run the script directly.
In your case the shebang line is #!/bin/bash\r\n where \r (carriage return) and \n (new line) are the visible representations of the non-printable characters. So the entrypoint tries to execute this:
Any invalid command in the shebang line would have the same result.
This is where I shared how I configured git on Windows to avoid this issue:
Thanks a lot for your reply. I did not apply your solution, but you pointed me in the right direction.
In a nutshell: I built the image in Ubuntu 20.04 App in Windows and it works.
I set up Ubuntu 20.04 App on Windows making sure WSL2 is installed (was missing).
Pulled repo from github in CLI
Changed Dockerfile in nano
After correctly setting up WSL2 in Ubuntu and configuring Docker Desktop I did not try to compile it again in cmder where I usualy work.
One can still pull repositories in Windows edit in e.g. in VSCode upload it and download it in the Ubuntu App in Windows. I know, I know there is a better way - its just a work around if you don’t want to fumble with configuration in Windows.