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
windows docker dockerfile docker-machine carriage-return
add a comment |
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
windows docker dockerfile docker-machine carriage-return
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
add a comment |
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
windows docker dockerfile docker-machine carriage-return
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
windows docker dockerfile docker-machine carriage-return
edited Nov 11 at 8:27
ErikMD
1,7461318
1,7461318
asked Nov 10 at 15:55
Anna K
4941920
4941920
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
add a comment |
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
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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