How to run my python script on docker?

前端 未结 6 400
小蘑菇
小蘑菇 2020-12-14 07:10

I am trying to run my python script on docker. I tried different ways to do it but not able to run it on docker. My python script is given below:

import os

         


        
6条回答
  •  时光取名叫无心
    2020-12-14 08:09

    Another way to run python script on docker can be:
    copy the local python script to docker:

    docker cp yourlocalscript.path container_id:/dst_path/ 
    

    container id can be found using:

    docker ps 
    

    run the python script on docker:

    docker exec -it python /container_script_path.py
    

提交回复
热议问题