standard_init_linux.go:190: exec user process caused “no such file or directory” - Docker












20















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









share|improve this question



























    20















    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









    share|improve this question

























      20












      20








      20


      4






      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









      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 24 '18 at 22:03









      gamechanger17gamechanger17

      1631112




      1631112
























          6 Answers
          6






          active

          oldest

          votes


















          25














          Use notepad++, go to edit -> EOL conversion -> change from CRLF to LF.






          share|improve this answer
























          • 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



















          24














          change entry point as below. It worked for me



          ENTRYPOINT ["sh","/run.sh"]





          share|improve this answer
























          • 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



















          9














          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






          share|improve this answer
























          • 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



















          1














          Replacing CRLF with LF using Notepad++




          1. 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”:

          2. Hit Replace All (ALT+A)


          Rebuild and run the docker image should solve your problem.






          share|improve this answer































            1














            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





            share|improve this answer

































              0














              Add this to your Dockerfile



              RUN cat /run.sh | tr -d 'r' > /run.sh





              share|improve this answer























                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
                });


                }
                });














                draft saved

                draft discarded


















                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









                25














                Use notepad++, go to edit -> EOL conversion -> change from CRLF to LF.






                share|improve this answer
























                • 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
















                25














                Use notepad++, go to edit -> EOL conversion -> change from CRLF to LF.






                share|improve this answer
























                • 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














                25












                25








                25







                Use notepad++, go to edit -> EOL conversion -> change from CRLF to LF.






                share|improve this answer













                Use notepad++, go to edit -> EOL conversion -> change from CRLF to LF.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                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



















                • 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













                24














                change entry point as below. It worked for me



                ENTRYPOINT ["sh","/run.sh"]





                share|improve this answer
























                • 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
















                24














                change entry point as below. It worked for me



                ENTRYPOINT ["sh","/run.sh"]





                share|improve this answer
























                • 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














                24












                24








                24







                change entry point as below. It worked for me



                ENTRYPOINT ["sh","/run.sh"]





                share|improve this answer













                change entry point as below. It worked for me



                ENTRYPOINT ["sh","/run.sh"]






                share|improve this answer












                share|improve this answer



                share|improve this answer










                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



















                • 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











                9














                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






                share|improve this answer
























                • 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
















                9














                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






                share|improve this answer
























                • 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














                9












                9








                9







                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






                share|improve this answer













                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







                share|improve this answer












                share|improve this answer



                share|improve this answer










                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



















                • 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











                1














                Replacing CRLF with LF using Notepad++




                1. 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”:

                2. Hit Replace All (ALT+A)


                Rebuild and run the docker image should solve your problem.






                share|improve this answer




























                  1














                  Replacing CRLF with LF using Notepad++




                  1. 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”:

                  2. Hit Replace All (ALT+A)


                  Rebuild and run the docker image should solve your problem.






                  share|improve this answer


























                    1












                    1








                    1







                    Replacing CRLF with LF using Notepad++




                    1. 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”:

                    2. Hit Replace All (ALT+A)


                    Rebuild and run the docker image should solve your problem.






                    share|improve this answer













                    Replacing CRLF with LF using Notepad++




                    1. 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”:

                    2. Hit Replace All (ALT+A)


                    Rebuild and run the docker image should solve your problem.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jan 2 at 9:09









                    Rajesh SamsonRajesh Samson

                    697716




                    697716























                        1














                        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





                        share|improve this answer






























                          1














                          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





                          share|improve this answer




























                            1












                            1








                            1







                            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





                            share|improve this answer















                            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






                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Mar 1 at 11:49









                            tuomastik

                            2,24712030




                            2,24712030










                            answered Jan 8 at 10:26









                            Amine_DevAmine_Dev

                            447411




                            447411























                                0














                                Add this to your Dockerfile



                                RUN cat /run.sh | tr -d 'r' > /run.sh





                                share|improve this answer




























                                  0














                                  Add this to your Dockerfile



                                  RUN cat /run.sh | tr -d 'r' > /run.sh





                                  share|improve this answer


























                                    0












                                    0








                                    0







                                    Add this to your Dockerfile



                                    RUN cat /run.sh | tr -d 'r' > /run.sh





                                    share|improve this answer













                                    Add this to your Dockerfile



                                    RUN cat /run.sh | tr -d 'r' > /run.sh






                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Jan 8 at 19:22









                                    Jose Boretto BlenginoJose Boretto Blengino

                                    16114




                                    16114






























                                        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.




                                        draft saved


                                        draft discarded














                                        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





















































                                        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







                                        Popular posts from this blog

                                        Monofisismo

                                        Angular Downloading a file using contenturl with Basic Authentication

                                        Olmecas