standard_init_linux.go:190: exec user process caused “no such file or directory” - Docker
When I am running my docker image on windows 10. I am getting this error:
standard_init_linux.go:190: exec user process caused "no such file or directory"
my docker file is:
FROM openjdk:8
EXPOSE 8080
VOLUME /tmp
ADD appagent.tar.gz /opt/app-agent
ADD services.jar app.jar
ADD run.sh /run.sh
# Install compiler and perl stuff
RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y gcc-multilib
RUN apt-get install -y perl
# Install Percona Toolkit
RUN apt-get install --yes percona-toolkit
RUN ["chmod", "+x", "/run.sh"]
ENTRYPOINT ["/run.sh"]
and the script is start with #!/bin/sh
#!/bin/sh
set -e
JAVA_OPTS="-Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/urandom"
if [ "${APPD_APP_NAME}" != "" ]; then
JAVA_AGENT="-javaagent:/opt/app-agent/javaagent.jar
fi
exec java ${JVM_OPTS} ${JAVA_OPTS} ${JAVA_AGENT} -jar /app.jar
Tried method1:
Tried changing #!/bin/sh to #!/bin/bash but getting same error.
Tried method2:
added dos2unix in docker file
RUN apt-get install -y dos2unix
RUN dos2unix /run.sh
docker dockerfile docker-for-windows
add a comment |
When I am running my docker image on windows 10. I am getting this error:
standard_init_linux.go:190: exec user process caused "no such file or directory"
my docker file is:
FROM openjdk:8
EXPOSE 8080
VOLUME /tmp
ADD appagent.tar.gz /opt/app-agent
ADD services.jar app.jar
ADD run.sh /run.sh
# Install compiler and perl stuff
RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y gcc-multilib
RUN apt-get install -y perl
# Install Percona Toolkit
RUN apt-get install --yes percona-toolkit
RUN ["chmod", "+x", "/run.sh"]
ENTRYPOINT ["/run.sh"]
and the script is start with #!/bin/sh
#!/bin/sh
set -e
JAVA_OPTS="-Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/urandom"
if [ "${APPD_APP_NAME}" != "" ]; then
JAVA_AGENT="-javaagent:/opt/app-agent/javaagent.jar
fi
exec java ${JVM_OPTS} ${JAVA_OPTS} ${JAVA_AGENT} -jar /app.jar
Tried method1:
Tried changing #!/bin/sh to #!/bin/bash but getting same error.
Tried method2:
added dos2unix in docker file
RUN apt-get install -y dos2unix
RUN dos2unix /run.sh
docker dockerfile docker-for-windows
add a comment |
When I am running my docker image on windows 10. I am getting this error:
standard_init_linux.go:190: exec user process caused "no such file or directory"
my docker file is:
FROM openjdk:8
EXPOSE 8080
VOLUME /tmp
ADD appagent.tar.gz /opt/app-agent
ADD services.jar app.jar
ADD run.sh /run.sh
# Install compiler and perl stuff
RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y gcc-multilib
RUN apt-get install -y perl
# Install Percona Toolkit
RUN apt-get install --yes percona-toolkit
RUN ["chmod", "+x", "/run.sh"]
ENTRYPOINT ["/run.sh"]
and the script is start with #!/bin/sh
#!/bin/sh
set -e
JAVA_OPTS="-Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/urandom"
if [ "${APPD_APP_NAME}" != "" ]; then
JAVA_AGENT="-javaagent:/opt/app-agent/javaagent.jar
fi
exec java ${JVM_OPTS} ${JAVA_OPTS} ${JAVA_AGENT} -jar /app.jar
Tried method1:
Tried changing #!/bin/sh to #!/bin/bash but getting same error.
Tried method2:
added dos2unix in docker file
RUN apt-get install -y dos2unix
RUN dos2unix /run.sh
docker dockerfile docker-for-windows
When I am running my docker image on windows 10. I am getting this error:
standard_init_linux.go:190: exec user process caused "no such file or directory"
my docker file is:
FROM openjdk:8
EXPOSE 8080
VOLUME /tmp
ADD appagent.tar.gz /opt/app-agent
ADD services.jar app.jar
ADD run.sh /run.sh
# Install compiler and perl stuff
RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y gcc-multilib
RUN apt-get install -y perl
# Install Percona Toolkit
RUN apt-get install --yes percona-toolkit
RUN ["chmod", "+x", "/run.sh"]
ENTRYPOINT ["/run.sh"]
and the script is start with #!/bin/sh
#!/bin/sh
set -e
JAVA_OPTS="-Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/urandom"
if [ "${APPD_APP_NAME}" != "" ]; then
JAVA_AGENT="-javaagent:/opt/app-agent/javaagent.jar
fi
exec java ${JVM_OPTS} ${JAVA_OPTS} ${JAVA_AGENT} -jar /app.jar
Tried method1:
Tried changing #!/bin/sh to #!/bin/bash but getting same error.
Tried method2:
added dos2unix in docker file
RUN apt-get install -y dos2unix
RUN dos2unix /run.sh
docker dockerfile docker-for-windows
docker dockerfile docker-for-windows
asked Jul 24 '18 at 22:03
gamechanger17gamechanger17
1631112
1631112
add a comment |
add a comment |
6 Answers
6
active
oldest
votes
Use notepad++, go to edit -> EOL conversion -> change from CRLF to LF.
Perfect! I had a .sh file added which was being run from my Dockerfile. I replaced the line endings and Ta Da. Thank you
– Sweet Chilly Philly
Nov 1 '18 at 22:26
add a comment |
change entry point as below. It worked for me
ENTRYPOINT ["sh","/run.sh"]
Worked for me. In this case, we do not even need to add #!/bin/sh in the shell script. Mentioning "sh" in the ENTRYPOINT does the job
– Gouravmoy Mohanty
Aug 11 '18 at 19:38
4
Can you explain why and when the "sh" is necessary? I saw many example working without.
– Opsse
Nov 30 '18 at 22:33
@Opsse Without"sh"
, normal shell processing does not happen source
– tuomastik
Mar 1 at 11:54
add a comment |
in my case I had to change line ending from CRLF
to LF
for the run.sh
file and the error was gone.
I hope this helps,
Kirsten
I have to keep fixing the same files over and over. It's like windows wants to keep me in it's ecosystem.
– Jonathan Czitkovics
Aug 17 '18 at 18:28
add a comment |
Replacing CRLF with LF using Notepad++
- Notepad++'s Find/Replace feature handles this requirement quite
nicely. Simply bring up the Replace dialogue (CTRL+H), select
Extended search mode (ALT+X), search for “rn” and replace with
“n”: - Hit Replace All (ALT+A)
Rebuild and run the docker image should solve your problem.
add a comment |
It's a CRLF problem. I fixed the problem using this:
git config --global core.eol lf
git config --global core.autocrlf input
find . -type f -print0 | xargs -0 dos2unix
add a comment |
Add this to your Dockerfile
RUN cat /run.sh | tr -d 'r' > /run.sh
add a comment |
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',
autoActivateHeartbeat: false,
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
});
}
});
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%2f51508150%2fstandard-init-linux-go190-exec-user-process-caused-no-such-file-or-directory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
Use notepad++, go to edit -> EOL conversion -> change from CRLF to LF.
Perfect! I had a .sh file added which was being run from my Dockerfile. I replaced the line endings and Ta Da. Thank you
– Sweet Chilly Philly
Nov 1 '18 at 22:26
add a comment |
Use notepad++, go to edit -> EOL conversion -> change from CRLF to LF.
Perfect! I had a .sh file added which was being run from my Dockerfile. I replaced the line endings and Ta Da. Thank you
– Sweet Chilly Philly
Nov 1 '18 at 22:26
add a comment |
Use notepad++, go to edit -> EOL conversion -> change from CRLF to LF.
Use notepad++, go to edit -> EOL conversion -> change from CRLF to LF.
answered Oct 5 '18 at 12:30
Vikas RathoreVikas Rathore
473512
473512
Perfect! I had a .sh file added which was being run from my Dockerfile. I replaced the line endings and Ta Da. Thank you
– Sweet Chilly Philly
Nov 1 '18 at 22:26
add a comment |
Perfect! I had a .sh file added which was being run from my Dockerfile. I replaced the line endings and Ta Da. Thank you
– Sweet Chilly Philly
Nov 1 '18 at 22:26
Perfect! I had a .sh file added which was being run from my Dockerfile. I replaced the line endings and Ta Da. Thank you
– Sweet Chilly Philly
Nov 1 '18 at 22:26
Perfect! I had a .sh file added which was being run from my Dockerfile. I replaced the line endings and Ta Da. Thank you
– Sweet Chilly Philly
Nov 1 '18 at 22:26
add a comment |
change entry point as below. It worked for me
ENTRYPOINT ["sh","/run.sh"]
Worked for me. In this case, we do not even need to add #!/bin/sh in the shell script. Mentioning "sh" in the ENTRYPOINT does the job
– Gouravmoy Mohanty
Aug 11 '18 at 19:38
4
Can you explain why and when the "sh" is necessary? I saw many example working without.
– Opsse
Nov 30 '18 at 22:33
@Opsse Without"sh"
, normal shell processing does not happen source
– tuomastik
Mar 1 at 11:54
add a comment |
change entry point as below. It worked for me
ENTRYPOINT ["sh","/run.sh"]
Worked for me. In this case, we do not even need to add #!/bin/sh in the shell script. Mentioning "sh" in the ENTRYPOINT does the job
– Gouravmoy Mohanty
Aug 11 '18 at 19:38
4
Can you explain why and when the "sh" is necessary? I saw many example working without.
– Opsse
Nov 30 '18 at 22:33
@Opsse Without"sh"
, normal shell processing does not happen source
– tuomastik
Mar 1 at 11:54
add a comment |
change entry point as below. It worked for me
ENTRYPOINT ["sh","/run.sh"]
change entry point as below. It worked for me
ENTRYPOINT ["sh","/run.sh"]
answered Aug 7 '18 at 5:29
prityprity
28118
28118
Worked for me. In this case, we do not even need to add #!/bin/sh in the shell script. Mentioning "sh" in the ENTRYPOINT does the job
– Gouravmoy Mohanty
Aug 11 '18 at 19:38
4
Can you explain why and when the "sh" is necessary? I saw many example working without.
– Opsse
Nov 30 '18 at 22:33
@Opsse Without"sh"
, normal shell processing does not happen source
– tuomastik
Mar 1 at 11:54
add a comment |
Worked for me. In this case, we do not even need to add #!/bin/sh in the shell script. Mentioning "sh" in the ENTRYPOINT does the job
– Gouravmoy Mohanty
Aug 11 '18 at 19:38
4
Can you explain why and when the "sh" is necessary? I saw many example working without.
– Opsse
Nov 30 '18 at 22:33
@Opsse Without"sh"
, normal shell processing does not happen source
– tuomastik
Mar 1 at 11:54
Worked for me. In this case, we do not even need to add #!/bin/sh in the shell script. Mentioning "sh" in the ENTRYPOINT does the job
– Gouravmoy Mohanty
Aug 11 '18 at 19:38
Worked for me. In this case, we do not even need to add #!/bin/sh in the shell script. Mentioning "sh" in the ENTRYPOINT does the job
– Gouravmoy Mohanty
Aug 11 '18 at 19:38
4
4
Can you explain why and when the "sh" is necessary? I saw many example working without.
– Opsse
Nov 30 '18 at 22:33
Can you explain why and when the "sh" is necessary? I saw many example working without.
– Opsse
Nov 30 '18 at 22:33
@Opsse Without
"sh"
, normal shell processing does not happen source– tuomastik
Mar 1 at 11:54
@Opsse Without
"sh"
, normal shell processing does not happen source– tuomastik
Mar 1 at 11:54
add a comment |
in my case I had to change line ending from CRLF
to LF
for the run.sh
file and the error was gone.
I hope this helps,
Kirsten
I have to keep fixing the same files over and over. It's like windows wants to keep me in it's ecosystem.
– Jonathan Czitkovics
Aug 17 '18 at 18:28
add a comment |
in my case I had to change line ending from CRLF
to LF
for the run.sh
file and the error was gone.
I hope this helps,
Kirsten
I have to keep fixing the same files over and over. It's like windows wants to keep me in it's ecosystem.
– Jonathan Czitkovics
Aug 17 '18 at 18:28
add a comment |
in my case I had to change line ending from CRLF
to LF
for the run.sh
file and the error was gone.
I hope this helps,
Kirsten
in my case I had to change line ending from CRLF
to LF
for the run.sh
file and the error was gone.
I hope this helps,
Kirsten
answered Jul 31 '18 at 19:28
KirKoneKirKone
25417
25417
I have to keep fixing the same files over and over. It's like windows wants to keep me in it's ecosystem.
– Jonathan Czitkovics
Aug 17 '18 at 18:28
add a comment |
I have to keep fixing the same files over and over. It's like windows wants to keep me in it's ecosystem.
– Jonathan Czitkovics
Aug 17 '18 at 18:28
I have to keep fixing the same files over and over. It's like windows wants to keep me in it's ecosystem.
– Jonathan Czitkovics
Aug 17 '18 at 18:28
I have to keep fixing the same files over and over. It's like windows wants to keep me in it's ecosystem.
– Jonathan Czitkovics
Aug 17 '18 at 18:28
add a comment |
Replacing CRLF with LF using Notepad++
- Notepad++'s Find/Replace feature handles this requirement quite
nicely. Simply bring up the Replace dialogue (CTRL+H), select
Extended search mode (ALT+X), search for “rn” and replace with
“n”: - Hit Replace All (ALT+A)
Rebuild and run the docker image should solve your problem.
add a comment |
Replacing CRLF with LF using Notepad++
- Notepad++'s Find/Replace feature handles this requirement quite
nicely. Simply bring up the Replace dialogue (CTRL+H), select
Extended search mode (ALT+X), search for “rn” and replace with
“n”: - Hit Replace All (ALT+A)
Rebuild and run the docker image should solve your problem.
add a comment |
Replacing CRLF with LF using Notepad++
- Notepad++'s Find/Replace feature handles this requirement quite
nicely. Simply bring up the Replace dialogue (CTRL+H), select
Extended search mode (ALT+X), search for “rn” and replace with
“n”: - Hit Replace All (ALT+A)
Rebuild and run the docker image should solve your problem.
Replacing CRLF with LF using Notepad++
- Notepad++'s Find/Replace feature handles this requirement quite
nicely. Simply bring up the Replace dialogue (CTRL+H), select
Extended search mode (ALT+X), search for “rn” and replace with
“n”: - Hit Replace All (ALT+A)
Rebuild and run the docker image should solve your problem.
answered Jan 2 at 9:09
Rajesh SamsonRajesh Samson
697716
697716
add a comment |
add a comment |
It's a CRLF problem. I fixed the problem using this:
git config --global core.eol lf
git config --global core.autocrlf input
find . -type f -print0 | xargs -0 dos2unix
add a comment |
It's a CRLF problem. I fixed the problem using this:
git config --global core.eol lf
git config --global core.autocrlf input
find . -type f -print0 | xargs -0 dos2unix
add a comment |
It's a CRLF problem. I fixed the problem using this:
git config --global core.eol lf
git config --global core.autocrlf input
find . -type f -print0 | xargs -0 dos2unix
It's a CRLF problem. I fixed the problem using this:
git config --global core.eol lf
git config --global core.autocrlf input
find . -type f -print0 | xargs -0 dos2unix
edited Mar 1 at 11:49
tuomastik
2,24712030
2,24712030
answered Jan 8 at 10:26
Amine_DevAmine_Dev
447411
447411
add a comment |
add a comment |
Add this to your Dockerfile
RUN cat /run.sh | tr -d 'r' > /run.sh
add a comment |
Add this to your Dockerfile
RUN cat /run.sh | tr -d 'r' > /run.sh
add a comment |
Add this to your Dockerfile
RUN cat /run.sh | tr -d 'r' > /run.sh
Add this to your Dockerfile
RUN cat /run.sh | tr -d 'r' > /run.sh
answered Jan 8 at 19:22
Jose Boretto BlenginoJose Boretto Blengino
16114
16114
add a comment |
add a comment |
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.
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%2f51508150%2fstandard-init-linux-go190-exec-user-process-caused-no-such-file-or-directory%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