I'm trying to create dockerfile similar to the following one:
FROM python:3.8-slim-buster
ENV FOO=bar
RUN python my_python_file.py  # use the FOO variable, and set PY_VERSION variable
FROM python:<PY_VERSION>-slim-buster
# continue dockerfile...
- How can I use the FOO variable from within my python my_python_filescript?
 (I think I can passFOOas an argument to theRUN python my_python_file.pycommand, and read the argument from within themy_python_file.pyfile. I wonder if there's an easier way, something that maybe usingos.getenv('FOO'))
- How can I set PY_VERSIONfrom within my pythonmy_python_filescript, to later be used by the 2ndFROMcommand -FROM python:<PY_VERSION>-slim-buster?
I dont have any control over how the docker build command is being executed.
 
     
    