Docker: Windows and Linux different output. Why?









up vote
0
down vote

favorite












I discovered a really strange behaviour of my Dockerfile. It works perfectly under my linux machine but under windows I got a weird output running my container. Could somebody check my commands and tell me what is wrong with them? Why it works under ubuntu without any problems? I thought docker ensures that it can be started in the same way under different operations systems...



Windows commands:



git clone https://github.com/falent/googleHomeAssistantExpressNodeJS.git C:Users%username%DocumentsgoogleHomeAssistantExpressNodeJS



$ cd C:Users%username%DocumentsgoogleHomeAssistantExpressNodeJS



$ sudo build -t assistant .



$ docker run -v /C/Users/%username%/Documents/googleHomeAssistantExpressNodeJS:/skill -it --name myAssistant assistant



I got this output under windows:



: not foundypoint.sh: 2: /skill/entrypoint.sh:
sleep: invalid time interval '10sr'
Try 'sleep --help' for more information.
/skill/entrypoint.sh: 4: cd: can't cd to /skill


Dockerfile:



FROM node:slim

RUN npm install -g nodemon@1.14.7

COPY package.json /skill/package.json

RUN mkdir -p /skill/
WORKDIR /skill/
RUN npm install

COPY entrypoint.sh /skill
RUN chmod +x /skill/entrypoint.sh

ENTRYPOINT ["sh","/skill/entrypoint.sh"]


entrypoint.sh



#!/bin/sh

sleep 10s
cd /skill
npm install
nodemon









share|improve this question























  • Do you have docker configured to use Linux-based containers on windows?
    – jonrsharpe
    Nov 10 at 16:05






  • 1




    Possible duplicate of Why would a correct shell script give a wrapped/truncated/corrupted error message?
    – ErikMD
    Nov 10 at 16:06










  • Just by reading your truncated error message : not foundypoint.sh: 2: /skill/entrypoint.sh: sleep: invalid time interval '10sr' it is almost sure that you have an encoding issue with your script (with Windows newlines "rn" instead of Linux newlines "n")
    – ErikMD
    Nov 10 at 16:08










  • @ErikMD how can I fix it? that it works under windows and linux?
    – Anna K
    Nov 10 at 16:12











  • You could try to follow the suggestions from this SO answer, and also make sure that your Git configuration on Windows doesn't silently turn all regular Linux newlines into Windows newlines...
    – ErikMD
    Nov 10 at 16:13















up vote
0
down vote

favorite












I discovered a really strange behaviour of my Dockerfile. It works perfectly under my linux machine but under windows I got a weird output running my container. Could somebody check my commands and tell me what is wrong with them? Why it works under ubuntu without any problems? I thought docker ensures that it can be started in the same way under different operations systems...



Windows commands:



git clone https://github.com/falent/googleHomeAssistantExpressNodeJS.git C:Users%username%DocumentsgoogleHomeAssistantExpressNodeJS



$ cd C:Users%username%DocumentsgoogleHomeAssistantExpressNodeJS



$ sudo build -t assistant .



$ docker run -v /C/Users/%username%/Documents/googleHomeAssistantExpressNodeJS:/skill -it --name myAssistant assistant



I got this output under windows:



: not foundypoint.sh: 2: /skill/entrypoint.sh:
sleep: invalid time interval '10sr'
Try 'sleep --help' for more information.
/skill/entrypoint.sh: 4: cd: can't cd to /skill


Dockerfile:



FROM node:slim

RUN npm install -g nodemon@1.14.7

COPY package.json /skill/package.json

RUN mkdir -p /skill/
WORKDIR /skill/
RUN npm install

COPY entrypoint.sh /skill
RUN chmod +x /skill/entrypoint.sh

ENTRYPOINT ["sh","/skill/entrypoint.sh"]


entrypoint.sh



#!/bin/sh

sleep 10s
cd /skill
npm install
nodemon









share|improve this question























  • Do you have docker configured to use Linux-based containers on windows?
    – jonrsharpe
    Nov 10 at 16:05






  • 1




    Possible duplicate of Why would a correct shell script give a wrapped/truncated/corrupted error message?
    – ErikMD
    Nov 10 at 16:06










  • Just by reading your truncated error message : not foundypoint.sh: 2: /skill/entrypoint.sh: sleep: invalid time interval '10sr' it is almost sure that you have an encoding issue with your script (with Windows newlines "rn" instead of Linux newlines "n")
    – ErikMD
    Nov 10 at 16:08










  • @ErikMD how can I fix it? that it works under windows and linux?
    – Anna K
    Nov 10 at 16:12











  • You could try to follow the suggestions from this SO answer, and also make sure that your Git configuration on Windows doesn't silently turn all regular Linux newlines into Windows newlines...
    – ErikMD
    Nov 10 at 16:13













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I discovered a really strange behaviour of my Dockerfile. It works perfectly under my linux machine but under windows I got a weird output running my container. Could somebody check my commands and tell me what is wrong with them? Why it works under ubuntu without any problems? I thought docker ensures that it can be started in the same way under different operations systems...



Windows commands:



git clone https://github.com/falent/googleHomeAssistantExpressNodeJS.git C:Users%username%DocumentsgoogleHomeAssistantExpressNodeJS



$ cd C:Users%username%DocumentsgoogleHomeAssistantExpressNodeJS



$ sudo build -t assistant .



$ docker run -v /C/Users/%username%/Documents/googleHomeAssistantExpressNodeJS:/skill -it --name myAssistant assistant



I got this output under windows:



: not foundypoint.sh: 2: /skill/entrypoint.sh:
sleep: invalid time interval '10sr'
Try 'sleep --help' for more information.
/skill/entrypoint.sh: 4: cd: can't cd to /skill


Dockerfile:



FROM node:slim

RUN npm install -g nodemon@1.14.7

COPY package.json /skill/package.json

RUN mkdir -p /skill/
WORKDIR /skill/
RUN npm install

COPY entrypoint.sh /skill
RUN chmod +x /skill/entrypoint.sh

ENTRYPOINT ["sh","/skill/entrypoint.sh"]


entrypoint.sh



#!/bin/sh

sleep 10s
cd /skill
npm install
nodemon









share|improve this question















I discovered a really strange behaviour of my Dockerfile. It works perfectly under my linux machine but under windows I got a weird output running my container. Could somebody check my commands and tell me what is wrong with them? Why it works under ubuntu without any problems? I thought docker ensures that it can be started in the same way under different operations systems...



Windows commands:



git clone https://github.com/falent/googleHomeAssistantExpressNodeJS.git C:Users%username%DocumentsgoogleHomeAssistantExpressNodeJS



$ cd C:Users%username%DocumentsgoogleHomeAssistantExpressNodeJS



$ sudo build -t assistant .



$ docker run -v /C/Users/%username%/Documents/googleHomeAssistantExpressNodeJS:/skill -it --name myAssistant assistant



I got this output under windows:



: not foundypoint.sh: 2: /skill/entrypoint.sh:
sleep: invalid time interval '10sr'
Try 'sleep --help' for more information.
/skill/entrypoint.sh: 4: cd: can't cd to /skill


Dockerfile:



FROM node:slim

RUN npm install -g nodemon@1.14.7

COPY package.json /skill/package.json

RUN mkdir -p /skill/
WORKDIR /skill/
RUN npm install

COPY entrypoint.sh /skill
RUN chmod +x /skill/entrypoint.sh

ENTRYPOINT ["sh","/skill/entrypoint.sh"]


entrypoint.sh



#!/bin/sh

sleep 10s
cd /skill
npm install
nodemon






windows docker dockerfile docker-machine carriage-return






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 8:27









ErikMD

1,9051318




1,9051318










asked Nov 10 at 15:55









Anna K

5011920




5011920











  • Do you have docker configured to use Linux-based containers on windows?
    – jonrsharpe
    Nov 10 at 16:05






  • 1




    Possible duplicate of Why would a correct shell script give a wrapped/truncated/corrupted error message?
    – ErikMD
    Nov 10 at 16:06










  • Just by reading your truncated error message : not foundypoint.sh: 2: /skill/entrypoint.sh: sleep: invalid time interval '10sr' it is almost sure that you have an encoding issue with your script (with Windows newlines "rn" instead of Linux newlines "n")
    – ErikMD
    Nov 10 at 16:08










  • @ErikMD how can I fix it? that it works under windows and linux?
    – Anna K
    Nov 10 at 16:12











  • You could try to follow the suggestions from this SO answer, and also make sure that your Git configuration on Windows doesn't silently turn all regular Linux newlines into Windows newlines...
    – ErikMD
    Nov 10 at 16:13

















  • Do you have docker configured to use Linux-based containers on windows?
    – jonrsharpe
    Nov 10 at 16:05






  • 1




    Possible duplicate of Why would a correct shell script give a wrapped/truncated/corrupted error message?
    – ErikMD
    Nov 10 at 16:06










  • Just by reading your truncated error message : not foundypoint.sh: 2: /skill/entrypoint.sh: sleep: invalid time interval '10sr' it is almost sure that you have an encoding issue with your script (with Windows newlines "rn" instead of Linux newlines "n")
    – ErikMD
    Nov 10 at 16:08










  • @ErikMD how can I fix it? that it works under windows and linux?
    – Anna K
    Nov 10 at 16:12











  • You could try to follow the suggestions from this SO answer, and also make sure that your Git configuration on Windows doesn't silently turn all regular Linux newlines into Windows newlines...
    – ErikMD
    Nov 10 at 16:13
















Do you have docker configured to use Linux-based containers on windows?
– jonrsharpe
Nov 10 at 16:05




Do you have docker configured to use Linux-based containers on windows?
– jonrsharpe
Nov 10 at 16:05




1




1




Possible duplicate of Why would a correct shell script give a wrapped/truncated/corrupted error message?
– ErikMD
Nov 10 at 16:06




Possible duplicate of Why would a correct shell script give a wrapped/truncated/corrupted error message?
– ErikMD
Nov 10 at 16:06












Just by reading your truncated error message : not foundypoint.sh: 2: /skill/entrypoint.sh: sleep: invalid time interval '10sr' it is almost sure that you have an encoding issue with your script (with Windows newlines "rn" instead of Linux newlines "n")
– ErikMD
Nov 10 at 16:08




Just by reading your truncated error message : not foundypoint.sh: 2: /skill/entrypoint.sh: sleep: invalid time interval '10sr' it is almost sure that you have an encoding issue with your script (with Windows newlines "rn" instead of Linux newlines "n")
– ErikMD
Nov 10 at 16:08












@ErikMD how can I fix it? that it works under windows and linux?
– Anna K
Nov 10 at 16:12





@ErikMD how can I fix it? that it works under windows and linux?
– Anna K
Nov 10 at 16:12













You could try to follow the suggestions from this SO answer, and also make sure that your Git configuration on Windows doesn't silently turn all regular Linux newlines into Windows newlines...
– ErikMD
Nov 10 at 16:13





You could try to follow the suggestions from this SO answer, and also make sure that your Git configuration on Windows doesn't silently turn all regular Linux newlines into Windows newlines...
– ErikMD
Nov 10 at 16:13


















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240682%2fdocker-windows-and-linux-different-output-why%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240682%2fdocker-windows-and-linux-different-output-why%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

What does pagestruct do in Eviews?

Dutch intervention in Lombok and Karangasem

Channel Islands