Unable to run docker-compose from ssh's shellHow do I fix ssh on a macMake PATH variable changes permanent on openSuserun script as user who has nologin shellHow to Update Text in File within Unix Shell ScriptPerl command line + add PATH before string in fileChange openssh default PATHGitlab CI - Deploy via SSH to remote servercommand not found when using docker containerrsync fails in crontabUnable to ssh to gcloud VM instance from google/cloud-sdk:alpine docker container

If I no longer control a permanent when it would be sacrificed, is it still sacrificed?

Make me a minimum magic sum

Who filmed the Apollo 11 trans-lunar injection?

Hostile Divisor Numbers

Can an Iranian citizen enter the USA on a Dutch passport?

Does Thanos's ship land in the middle of the battlefield in "Avengers: Endgame"?

What do you call a painting painted on a wall?

How to deal with employer who keeps me at work after working hours

Why doesn't a particle exert force on itself?

Installing Debian 10, upgrade to stable later?

Which "exotic salt" can lower water's freezing point by –70 °C?

Can a player choose to add detail and flavor to their character's spells and abilities?

How important are good looking people in a novel/story?

Where to draw the line between quantum mechanics theory and its interpretation(s)?

How is Pauli's exclusion principle still valid in these cases?

Picking a theme as a discovery writer

Was there a dinosaur-counter in the original Jurassic Park movie?

Is there a reason why Turkey took the Balkan territories of the Ottoman Empire, instead of Greece or another of the Balkan states?

Python 3 - simple temperature program version 1.3

The selling of the sheep

What does のそ mean on this picture?

Why does blending blueberries, milk, banana and vanilla extract cause the mixture to have a yogurty consistency?

What is monoid homomorphism exactly?

Why is the blank symbol not considered part of the input alphabet of a Turing machine?



Unable to run docker-compose from ssh's shell


How do I fix ssh on a macMake PATH variable changes permanent on openSuserun script as user who has nologin shellHow to Update Text in File within Unix Shell ScriptPerl command line + add PATH before string in fileChange openssh default PATHGitlab CI - Deploy via SSH to remote servercommand not found when using docker containerrsync fails in crontabUnable to ssh to gcloud VM instance from google/cloud-sdk:alpine docker container






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm working on setting up a script in my .gitlab-ci.yml file so that I'm able to deploy a newly built Docker image to my server.



Here is how it looks so far:



- ssh deploy@my.private.vps '/bin/sh -c "cd /home/project/some/directory &&
export PATH=/bin:/usr/bin:/usr/local/bin &&
docker-compose stop web &&
docker-compose rm -f web &&
docker-compose up -d web &&
docker-compose exec web php artisan storage:link &&
exit"'


However, I keep getting "docker-compose: command not found" when running the command. Of course, docker-compose is install and available for the user 'deploy' when I log in with the user.



I found during my researches that it was because SSH doesn't load usr/local/bin by default. I tried to solve this issue by enabling the user's profile in the /etc/ssh/sshd_config file, and to export the PATH when running the script.



I'm running out of ideas on what I should try next.



What should I do?



Any idea welcome










share|improve this question




























    0















    I'm working on setting up a script in my .gitlab-ci.yml file so that I'm able to deploy a newly built Docker image to my server.



    Here is how it looks so far:



    - ssh deploy@my.private.vps '/bin/sh -c "cd /home/project/some/directory &&
    export PATH=/bin:/usr/bin:/usr/local/bin &&
    docker-compose stop web &&
    docker-compose rm -f web &&
    docker-compose up -d web &&
    docker-compose exec web php artisan storage:link &&
    exit"'


    However, I keep getting "docker-compose: command not found" when running the command. Of course, docker-compose is install and available for the user 'deploy' when I log in with the user.



    I found during my researches that it was because SSH doesn't load usr/local/bin by default. I tried to solve this issue by enabling the user's profile in the /etc/ssh/sshd_config file, and to export the PATH when running the script.



    I'm running out of ideas on what I should try next.



    What should I do?



    Any idea welcome










    share|improve this question
























      0












      0








      0








      I'm working on setting up a script in my .gitlab-ci.yml file so that I'm able to deploy a newly built Docker image to my server.



      Here is how it looks so far:



      - ssh deploy@my.private.vps '/bin/sh -c "cd /home/project/some/directory &&
      export PATH=/bin:/usr/bin:/usr/local/bin &&
      docker-compose stop web &&
      docker-compose rm -f web &&
      docker-compose up -d web &&
      docker-compose exec web php artisan storage:link &&
      exit"'


      However, I keep getting "docker-compose: command not found" when running the command. Of course, docker-compose is install and available for the user 'deploy' when I log in with the user.



      I found during my researches that it was because SSH doesn't load usr/local/bin by default. I tried to solve this issue by enabling the user's profile in the /etc/ssh/sshd_config file, and to export the PATH when running the script.



      I'm running out of ideas on what I should try next.



      What should I do?



      Any idea welcome










      share|improve this question














      I'm working on setting up a script in my .gitlab-ci.yml file so that I'm able to deploy a newly built Docker image to my server.



      Here is how it looks so far:



      - ssh deploy@my.private.vps '/bin/sh -c "cd /home/project/some/directory &&
      export PATH=/bin:/usr/bin:/usr/local/bin &&
      docker-compose stop web &&
      docker-compose rm -f web &&
      docker-compose up -d web &&
      docker-compose exec web php artisan storage:link &&
      exit"'


      However, I keep getting "docker-compose: command not found" when running the command. Of course, docker-compose is install and available for the user 'deploy' when I log in with the user.



      I found during my researches that it was because SSH doesn't load usr/local/bin by default. I tried to solve this issue by enabling the user's profile in the /etc/ssh/sshd_config file, and to export the PATH when running the script.



      I'm running out of ideas on what I should try next.



      What should I do?



      Any idea welcome







      ssh bash shell






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 27 at 15:23









      JaegerJaeger

      1158




      1158




















          1 Answer
          1






          active

          oldest

          votes


















          1














          Use



          which docker-compose


          or



          whereis docker-compose


          to find out what is its absolute path.



          Make sure this path is added to your PATH env.



          You can also just change your docker-compose into fullpath commands:



          /usr/local/bin/docker-compose stop web (...)






          share|improve this answer























          • That's a good idea, I ended up running commands such as /usr/local/bin/docker-compose exec <some command>

            – Jaeger
            Apr 29 at 19:51











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "2"
          ;
          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%2fserverfault.com%2fquestions%2f964859%2funable-to-run-docker-compose-from-sshs-shell%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Use



          which docker-compose


          or



          whereis docker-compose


          to find out what is its absolute path.



          Make sure this path is added to your PATH env.



          You can also just change your docker-compose into fullpath commands:



          /usr/local/bin/docker-compose stop web (...)






          share|improve this answer























          • That's a good idea, I ended up running commands such as /usr/local/bin/docker-compose exec <some command>

            – Jaeger
            Apr 29 at 19:51















          1














          Use



          which docker-compose


          or



          whereis docker-compose


          to find out what is its absolute path.



          Make sure this path is added to your PATH env.



          You can also just change your docker-compose into fullpath commands:



          /usr/local/bin/docker-compose stop web (...)






          share|improve this answer























          • That's a good idea, I ended up running commands such as /usr/local/bin/docker-compose exec <some command>

            – Jaeger
            Apr 29 at 19:51













          1












          1








          1







          Use



          which docker-compose


          or



          whereis docker-compose


          to find out what is its absolute path.



          Make sure this path is added to your PATH env.



          You can also just change your docker-compose into fullpath commands:



          /usr/local/bin/docker-compose stop web (...)






          share|improve this answer













          Use



          which docker-compose


          or



          whereis docker-compose


          to find out what is its absolute path.



          Make sure this path is added to your PATH env.



          You can also just change your docker-compose into fullpath commands:



          /usr/local/bin/docker-compose stop web (...)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 28 at 17:55









          ComarComar

          27116




          27116












          • That's a good idea, I ended up running commands such as /usr/local/bin/docker-compose exec <some command>

            – Jaeger
            Apr 29 at 19:51

















          • That's a good idea, I ended up running commands such as /usr/local/bin/docker-compose exec <some command>

            – Jaeger
            Apr 29 at 19:51
















          That's a good idea, I ended up running commands such as /usr/local/bin/docker-compose exec <some command>

          – Jaeger
          Apr 29 at 19:51





          That's a good idea, I ended up running commands such as /usr/local/bin/docker-compose exec <some command>

          – Jaeger
          Apr 29 at 19:51

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Server Fault!


          • 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%2fserverfault.com%2fquestions%2f964859%2funable-to-run-docker-compose-from-sshs-shell%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

          How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

          What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

          Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos