I'm trying to set an ENV equal to a python script output in my dockerfile. Due to layering, I'm unable to find a way to have them on the same layer. I've also been unable to find a way set the variable directly equal to the script, I can't seem to find how to run the script in the same line.
The python is a simple print, called test.py:
#!/usr/bin/env python
print("xd")
So far, I've tried a few versions of the below in my dockerfile to set the ENV to the script:
ENV testvar=test.py
ENV testvar=$(test.py)
ENV testvar='python test.py'
Is there anyway to set ENV testvar equal to the script in one step or a way to ensure the script and setting the variable are done on the same layer?