microservices-patterns / ftgo-application

Example code for the book Microservice patterns
Other
3.35k stars 1.29k forks source link

Suspected problem with line endings of shell script run in Docker on Windows host #89

Closed cer closed 4 years ago

cer commented 4 years ago

This looks like the problem - see end of MySQL log:

usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/4.compile-schema-per-service.sh
/docker-entrypoint-initdb.d/4.compile-schema-per-service.sh: line 2: $'\r': command not found

The MySQL server is failing to start because of what looks like a Windows vs. Linux line ending problem.

I think what has happened is that git clone checked out files with line endings suitable for your windows machine. However, this is a problem for mysql/*.sh since they execute in a Linux Docker container.

Can you try converting the line ends of those files to Linux-style newline. https://stackoverflow.com/questions/20368781/anything-like-dos2unix-for-windows

Originally posted by @cer in https://github.com/microservices-patterns/ftgo-application/issues/85#issuecomment-619217397

cer commented 4 years ago

See https://help.github.com/en/github/using-git/configuring-git-to-handle-line-endings