用docker for win10来build镜像,发现COPY到镜像的源文件的换行符都被改了
程序员文章站
2022-03-30 20:07:44
...
git diff命令如下:
# git diff selenium60.sh
diff --git a/selenium60.sh b/selenium60.sh
index 6ce5f9f..8893fb3 100644
--- a/selenium60.sh
+++ b/selenium60.sh
@@ -1,2 +1,2 @@
-#!/bin/sh
+#!/bin/sh^M
java -Dphantomjs.binary.path=vendor/bin/phantomjs -Dwebdriver.firefox.profile=default -Dwebdriver.reap_profile=true -jar vendor/bin/selenium-standalone.jar -timeout 60 -browserTimeout 60
\ No newline at end of file
因为我想继续在生产环境中用git来pull更新代码,所以一旦换行符被改了就没法更新代码了……
有什么办法让docker不修改我的换行符么?
回复内容:
git diff命令如下:
# git diff selenium60.sh
diff --git a/selenium60.sh b/selenium60.sh
index 6ce5f9f..8893fb3 100644
--- a/selenium60.sh
+++ b/selenium60.sh
@@ -1,2 +1,2 @@
-#!/bin/sh
+#!/bin/sh^M
java -Dphantomjs.binary.path=vendor/bin/phantomjs -Dwebdriver.firefox.profile=default -Dwebdriver.reap_profile=true -jar vendor/bin/selenium-standalone.jar -timeout 60 -browserTimeout 60
\ No newline at end of file
因为我想继续在生产环境中用git来pull更新代码,所以一旦换行符被改了就没法更新代码了……
有什么办法让docker不修改我的换行符么?