Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to run python file from cmd in dockerfile

FROM python:3

ADD my_script.py /

RUN pip install pystrich

CMD [ "python", "./my_script.py" ]
Comment

dockerfile to run python script

docker run -it --rm --name my-first-python-script -v "$PWD":/usr/src/widget_app python:3 python my_script.py
Comment

Docker Python Script Run

# Dockerfile
FROM python:3

ADD my_script.py /

CMD [ "python", "./my_script.py" ]

# Commandline
docker run IMAGE /path/to/script.py
Comment

docker run python

docker run -it --rm --name python-script -v "$PWD":/usr/src/app python:3 python ./usr/src/app/script.py
Comment

PREVIOUS NEXT
Code Example
Python :: python max value in list 
Python :: dataframe summarize how many in each column 
Python :: pandas split tuple column 
Python :: pyttsx3 
Python :: python in stack 
Python :: pandas filter column with or 
Python :: binary list to decimal 
Python :: python IndexError: list assignment index out of range 
Python :: python get index of substring in liast 
Python :: while python 
Python :: move object towards coordinate slowly pygame 
Python :: elementwise comparison list python 
Python :: python object name 
Python :: is python a scripting language 
Python :: nth root of a number python 
Python :: array in python 
Python :: print format python 
Python :: python search in json file 
Python :: learn basic facts about dataframe | dataframe info 
Python :: join 3 dataframes by index python 
Python :: set default formatter for python vscode 
Python :: python tkinter menu widget 
Python :: indentation in python 
Python :: how to extract zip file using python 
Python :: yaml validator python 
Python :: remove all parentheses from string python 
Python :: python svg viewing 
Python :: Django Abstract base classe 
Python :: python increment filename by 1 
Python :: python timeit function return value 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =