How to Set up Python Interpreter and running Python Code on Docker Container
Let’ see how can we set up Python Interpreter and running Python Code on Docker Container.
1. Download the image which supports python interpreter.
The Image I found is centos: 8, it supports python interpreter.
Command used to download the image: docker pull centos:8
2. Now, Run the container using the centos image
Command used: docker run -it — name myos2 centos:8
3. Download python3 using the DNF command
Command used: dnf install python3 -y
4. Check that python has installed or not
Command used: python3 -V
5. Create a python File and run it
Command used: mkdir pythoncode
The file has successfully run. Hello printed.