Python & DockeršŸ‹

šŸ’šŸ»ā€ā™€ļøPython is a popular programming language. It was created byĀ Guido van Rossum, and released inĀ 1991. Itā€™sĀ latest versionĀ isĀ Python 3.7

Task DescriptionšŸ“ƒ

Setting up Python Interpreter and running python code on docker container.

Letā€™s move towards practical part..

Firstly before running docker services i will disable firewall security of base o.s usingĀ #systemctl stop firewalldĀ & change mode of SELINUX .Here #setenforce 0Ā is a command which changes SELINUX fromĀ targeted to Permissive Mode. In this mode, we can perform all actions without any security issues.

Now we willĀ check our docker images

We can use #docker ps -a here in above image we can see my all last exited o.s , now here i got my previously used container unique id & name.

So by usingĀ #docker start os-idĀ here i started my previous o.s simultaneously i also wentĀ inside o.sĀ usingĀ #docker attach os-id.

Hence,we can say docker providesĀ permanentĀ storage of all our files,dataĀ etc.Until we manually terminate it.

Now itā€™s timeĀ to set-up python interpreter so we need to install itĀ by using command :Ā #yum install python3

Letā€™s nowĀ run python interpreter

HereĀ #python3Ā is the command which helps the user to enter into a python interpreter.

Now we will make a python file usingĀ #vi gc.py

Then to run this code we will useĀ #python3 filename.py

Finally, our Task_7.2_B i.e Setting up Python Interpreter and running python code on docker container is accomplished !

Thank you !

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store