/bin/sh: docker-php-source: not found進入當前容器,發現docker-php-source文件存在但是也無法執行~
發現docker-php-source文件的每行結尾都會有一個^M符號,這是因為 DOS下的編輯器和Linux編輯器對文件行末的回車符處理不一致,
對於回車符的定義:
windows:0D0A
unix\linux: 0A
MAC: 0D
解決:
git config -l
看看 core.autocrlf
的設置是不是 true
。
git 客戶端應該都設置為 false
,當然,服務器上的 git 客戶端需要保持 true
。
代碼編輯器換行默認符號都應該設置為 unix
,以下是常用編輯器的默認設置方法
- Sublime -> Preferences -> Settings -> User ->
"default_line_ending": "unix",
- Notepad++ -> 設置(Settings) -> 首選項(Preferences) -> 新建(New Document) ->
Unix(LF)
- PhpStorm -> File -> Settings -> Editor -> Code Style -> Line separator ->
Unix and OS X (\n)