What is the right way for running multiple commands in one action
?
For example:
I want to run a python script as action
. Before running this script I need to install the requirements.txt
.
I can think of several options:
- Create a
Dockerfile
with the commandRUN pip install -r requirements.txt
in it. - Use the
python:3
image, and run thepip install -r requirements.txt
in theentrypoint.sh
file before running the arguments fromargs
inmain.workflow
. - use both
pip install
andpython myscript.py
asargs
Another example:
I want to run a script that exists in my repository, then compare 2 files (its output and a file that already exists).
This is a process that includes two commands, whereas in the first example, the pip install
command can be considered a building command rather than a test command.
the question:
Can I create another Docker for another command, which will contain the output of the previous Docker?
I'm looking for guidelines for the location of the command in Dockerfile
, in entrypoint
or in args
.