docker container python subprocess.Popen php5.6 script is it possible to execute?Terminating a Python scriptFinding the index of an item given a list containing it in PythonHow can you profile a Python script?Does Python have a string 'contains' substring method?How to list containers in DockerHow to remove old Docker containersCopying files from Docker container to hostCopying files from host to Docker containerWhat is the difference between a Docker image and a container?From inside of a Docker container, how do I connect to the localhost of the machine?

Carroll's interpretation of 1-forms

What exactly is a web font, and what does converting to one involve?

Plot irregular circle in latex

merging certain list elements

Visualizing lines in QGIS

Lumens specs when buying a flashlight/torch. Why maglite has only 680lm but cheap ones have 900,000?

How is underwater propagation of sound possible?

Do household ovens ventilate heat to the outdoors?

What is the word for a person who destroys monuments?

Can one guy with a duplicator trigger a nuclear apocalypse?

Compare FEM mesh with the mesh created within Mathematica

How can I check that parent has more than 1 child?

What the did the controller say during my approach to land (audio clip)?

Applications of mathematics in clinical setting

Is a global DNS record a security risk for phpMyAdmin?

Amiga 500 OCS/ECS vs Mega Drive VDP

What is the origin of the "being immortal sucks" trope?

Can Brexit be undone in an emergency?

Is this adjustment to the Lucky feat underpowered?

Persuading players to be less attached to a pre-session 0 character concept

How do rulers get rich from war?

Which block cipher parameters should be kept secret?

Delete empty subfolders, keep parent folder

Is Zack Morris's 'time stop' ability in "Saved By the Bell" a supernatural ability?



docker container python subprocess.Popen php5.6 script is it possible to execute?


Terminating a Python scriptFinding the index of an item given a list containing it in PythonHow can you profile a Python script?Does Python have a string 'contains' substring method?How to list containers in DockerHow to remove old Docker containersCopying files from Docker container to hostCopying files from host to Docker containerWhat is the difference between a Docker image and a container?From inside of a Docker container, how do I connect to the localhost of the machine?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm trying to dockerize my python app locally. The app works perfectly when I start in in terminal (Linux mint 19.1). The app has some outputs from the app-shell. First one is connecting with mysql server. Another one is calling python subprocess lib..



proxiScript = 'php5.6 -V'



subprocess.Popen(proxiScript, shell=True, stdout=subprocess.PIPE)



When I create a docker image, at first, I had problem with connecting to mysql [ I solve it with docker run --net host image_name ].



The second problem is..
/bin/sh: 1: php5.6: not found



Is there a way to build a standalone image where I'll include all of the needs I'm using in my project.. Maybe I could use host terminal, to making my image successfull ?



Thank you ..



FROM app ->



`
proxiScript = "php5.6 -v "
proc=subprocess.Popen(proxiScript, shell=True, stdout=subprocess.PIPE)`


Dockerfile



FROM python:3.7-slim
WORKDIR /app
COPY . /app
RUN pip install --trusted-host pypi.python.org -r requirements.txt
EXPOSE 80
CMD ["python", "test.py"]










share|improve this question






























    0















    I'm trying to dockerize my python app locally. The app works perfectly when I start in in terminal (Linux mint 19.1). The app has some outputs from the app-shell. First one is connecting with mysql server. Another one is calling python subprocess lib..



    proxiScript = 'php5.6 -V'



    subprocess.Popen(proxiScript, shell=True, stdout=subprocess.PIPE)



    When I create a docker image, at first, I had problem with connecting to mysql [ I solve it with docker run --net host image_name ].



    The second problem is..
    /bin/sh: 1: php5.6: not found



    Is there a way to build a standalone image where I'll include all of the needs I'm using in my project.. Maybe I could use host terminal, to making my image successfull ?



    Thank you ..



    FROM app ->



    `
    proxiScript = "php5.6 -v "
    proc=subprocess.Popen(proxiScript, shell=True, stdout=subprocess.PIPE)`


    Dockerfile



    FROM python:3.7-slim
    WORKDIR /app
    COPY . /app
    RUN pip install --trusted-host pypi.python.org -r requirements.txt
    EXPOSE 80
    CMD ["python", "test.py"]










    share|improve this question


























      0












      0








      0








      I'm trying to dockerize my python app locally. The app works perfectly when I start in in terminal (Linux mint 19.1). The app has some outputs from the app-shell. First one is connecting with mysql server. Another one is calling python subprocess lib..



      proxiScript = 'php5.6 -V'



      subprocess.Popen(proxiScript, shell=True, stdout=subprocess.PIPE)



      When I create a docker image, at first, I had problem with connecting to mysql [ I solve it with docker run --net host image_name ].



      The second problem is..
      /bin/sh: 1: php5.6: not found



      Is there a way to build a standalone image where I'll include all of the needs I'm using in my project.. Maybe I could use host terminal, to making my image successfull ?



      Thank you ..



      FROM app ->



      `
      proxiScript = "php5.6 -v "
      proc=subprocess.Popen(proxiScript, shell=True, stdout=subprocess.PIPE)`


      Dockerfile



      FROM python:3.7-slim
      WORKDIR /app
      COPY . /app
      RUN pip install --trusted-host pypi.python.org -r requirements.txt
      EXPOSE 80
      CMD ["python", "test.py"]










      share|improve this question














      I'm trying to dockerize my python app locally. The app works perfectly when I start in in terminal (Linux mint 19.1). The app has some outputs from the app-shell. First one is connecting with mysql server. Another one is calling python subprocess lib..



      proxiScript = 'php5.6 -V'



      subprocess.Popen(proxiScript, shell=True, stdout=subprocess.PIPE)



      When I create a docker image, at first, I had problem with connecting to mysql [ I solve it with docker run --net host image_name ].



      The second problem is..
      /bin/sh: 1: php5.6: not found



      Is there a way to build a standalone image where I'll include all of the needs I'm using in my project.. Maybe I could use host terminal, to making my image successfull ?



      Thank you ..



      FROM app ->



      `
      proxiScript = "php5.6 -v "
      proc=subprocess.Popen(proxiScript, shell=True, stdout=subprocess.PIPE)`


      Dockerfile



      FROM python:3.7-slim
      WORKDIR /app
      COPY . /app
      RUN pip install --trusted-host pypi.python.org -r requirements.txt
      EXPOSE 80
      CMD ["python", "test.py"]







      php python docker subprocess containers






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 13:43









      Никола НиколовскиНикола Николовски

      1




      1

























          1 Answer
          1






          active

          oldest

          votes


















          0
















          I think you should add environment path like the following(example, use the ones appropriate for your case):



          ENV LD_LIBRARY_PATH /opt/rh/python27/root/usr/lib64
          ENV PATH /opt/rh/python27/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin


          Shouldn't you be using an php5 image instead?



          Are you sure that you have everything that you need on that python:3.7-slim image?



          What are our requirements.txt?



          From what I saw on this image, this is a debian 9 with no php5 package installed



          You may build your own image and use it like this:



          Dockerfile:
          FROM alpine:3.5



          ENV http_proxy http://proxyapps.gsnet.corp:80
          ENV https_proxy https://proxyapps.gsnet.corp:80

          RUN apk add --update
          python
          python-dev
          py-pip
          build-base
          php5


          Running this container on interactive mode you may get this:



          docker run -ti "yourimage"
          / # /usr/bin/php5 -v
          PHP 5.6.38 (cli) (built: Oct 1 2018 14:20:42)
          Copyright (c) 1997-2016 The PHP Group
          Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

          / # /usr/bin/python -V
          Python 2.7.15





          share|improve this answer



























          • Added ENV PATH $PATH (from terminal) but error docker run --net host image_name /bin/sh: 1: php5.6: not found Still occured ..

            – Никола Николовски
            Mar 28 at 14:11












          • updated my answer with a Dockerfile example that my provide functionality that you may need, did not add pip install, leave that to you

            – Ikaro0
            Mar 28 at 14:57










          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/4.0/"u003ecc by-sa 4.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%2f55399145%2fdocker-container-python-subprocess-popen-php5-6-script-is-it-possible-to-execute%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









          0
















          I think you should add environment path like the following(example, use the ones appropriate for your case):



          ENV LD_LIBRARY_PATH /opt/rh/python27/root/usr/lib64
          ENV PATH /opt/rh/python27/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin


          Shouldn't you be using an php5 image instead?



          Are you sure that you have everything that you need on that python:3.7-slim image?



          What are our requirements.txt?



          From what I saw on this image, this is a debian 9 with no php5 package installed



          You may build your own image and use it like this:



          Dockerfile:
          FROM alpine:3.5



          ENV http_proxy http://proxyapps.gsnet.corp:80
          ENV https_proxy https://proxyapps.gsnet.corp:80

          RUN apk add --update
          python
          python-dev
          py-pip
          build-base
          php5


          Running this container on interactive mode you may get this:



          docker run -ti "yourimage"
          / # /usr/bin/php5 -v
          PHP 5.6.38 (cli) (built: Oct 1 2018 14:20:42)
          Copyright (c) 1997-2016 The PHP Group
          Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

          / # /usr/bin/python -V
          Python 2.7.15





          share|improve this answer



























          • Added ENV PATH $PATH (from terminal) but error docker run --net host image_name /bin/sh: 1: php5.6: not found Still occured ..

            – Никола Николовски
            Mar 28 at 14:11












          • updated my answer with a Dockerfile example that my provide functionality that you may need, did not add pip install, leave that to you

            – Ikaro0
            Mar 28 at 14:57















          0
















          I think you should add environment path like the following(example, use the ones appropriate for your case):



          ENV LD_LIBRARY_PATH /opt/rh/python27/root/usr/lib64
          ENV PATH /opt/rh/python27/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin


          Shouldn't you be using an php5 image instead?



          Are you sure that you have everything that you need on that python:3.7-slim image?



          What are our requirements.txt?



          From what I saw on this image, this is a debian 9 with no php5 package installed



          You may build your own image and use it like this:



          Dockerfile:
          FROM alpine:3.5



          ENV http_proxy http://proxyapps.gsnet.corp:80
          ENV https_proxy https://proxyapps.gsnet.corp:80

          RUN apk add --update
          python
          python-dev
          py-pip
          build-base
          php5


          Running this container on interactive mode you may get this:



          docker run -ti "yourimage"
          / # /usr/bin/php5 -v
          PHP 5.6.38 (cli) (built: Oct 1 2018 14:20:42)
          Copyright (c) 1997-2016 The PHP Group
          Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

          / # /usr/bin/python -V
          Python 2.7.15





          share|improve this answer



























          • Added ENV PATH $PATH (from terminal) but error docker run --net host image_name /bin/sh: 1: php5.6: not found Still occured ..

            – Никола Николовски
            Mar 28 at 14:11












          • updated my answer with a Dockerfile example that my provide functionality that you may need, did not add pip install, leave that to you

            – Ikaro0
            Mar 28 at 14:57













          0














          0










          0









          I think you should add environment path like the following(example, use the ones appropriate for your case):



          ENV LD_LIBRARY_PATH /opt/rh/python27/root/usr/lib64
          ENV PATH /opt/rh/python27/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin


          Shouldn't you be using an php5 image instead?



          Are you sure that you have everything that you need on that python:3.7-slim image?



          What are our requirements.txt?



          From what I saw on this image, this is a debian 9 with no php5 package installed



          You may build your own image and use it like this:



          Dockerfile:
          FROM alpine:3.5



          ENV http_proxy http://proxyapps.gsnet.corp:80
          ENV https_proxy https://proxyapps.gsnet.corp:80

          RUN apk add --update
          python
          python-dev
          py-pip
          build-base
          php5


          Running this container on interactive mode you may get this:



          docker run -ti "yourimage"
          / # /usr/bin/php5 -v
          PHP 5.6.38 (cli) (built: Oct 1 2018 14:20:42)
          Copyright (c) 1997-2016 The PHP Group
          Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

          / # /usr/bin/python -V
          Python 2.7.15





          share|improve this answer















          I think you should add environment path like the following(example, use the ones appropriate for your case):



          ENV LD_LIBRARY_PATH /opt/rh/python27/root/usr/lib64
          ENV PATH /opt/rh/python27/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin


          Shouldn't you be using an php5 image instead?



          Are you sure that you have everything that you need on that python:3.7-slim image?



          What are our requirements.txt?



          From what I saw on this image, this is a debian 9 with no php5 package installed



          You may build your own image and use it like this:



          Dockerfile:
          FROM alpine:3.5



          ENV http_proxy http://proxyapps.gsnet.corp:80
          ENV https_proxy https://proxyapps.gsnet.corp:80

          RUN apk add --update
          python
          python-dev
          py-pip
          build-base
          php5


          Running this container on interactive mode you may get this:



          docker run -ti "yourimage"
          / # /usr/bin/php5 -v
          PHP 5.6.38 (cli) (built: Oct 1 2018 14:20:42)
          Copyright (c) 1997-2016 The PHP Group
          Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

          / # /usr/bin/python -V
          Python 2.7.15






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 28 at 14:52

























          answered Mar 28 at 13:49









          Ikaro0Ikaro0

          3301 silver badge11 bronze badges




          3301 silver badge11 bronze badges















          • Added ENV PATH $PATH (from terminal) but error docker run --net host image_name /bin/sh: 1: php5.6: not found Still occured ..

            – Никола Николовски
            Mar 28 at 14:11












          • updated my answer with a Dockerfile example that my provide functionality that you may need, did not add pip install, leave that to you

            – Ikaro0
            Mar 28 at 14:57

















          • Added ENV PATH $PATH (from terminal) but error docker run --net host image_name /bin/sh: 1: php5.6: not found Still occured ..

            – Никола Николовски
            Mar 28 at 14:11












          • updated my answer with a Dockerfile example that my provide functionality that you may need, did not add pip install, leave that to you

            – Ikaro0
            Mar 28 at 14:57
















          Added ENV PATH $PATH (from terminal) but error docker run --net host image_name /bin/sh: 1: php5.6: not found Still occured ..

          – Никола Николовски
          Mar 28 at 14:11






          Added ENV PATH $PATH (from terminal) but error docker run --net host image_name /bin/sh: 1: php5.6: not found Still occured ..

          – Никола Николовски
          Mar 28 at 14:11














          updated my answer with a Dockerfile example that my provide functionality that you may need, did not add pip install, leave that to you

          – Ikaro0
          Mar 28 at 14:57





          updated my answer with a Dockerfile example that my provide functionality that you may need, did not add pip install, leave that to you

          – Ikaro0
          Mar 28 at 14:57








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.




















          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%2f55399145%2fdocker-container-python-subprocess-popen-php5-6-script-is-it-possible-to-execute%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

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript