Setting up Python Interpreter and running Python Code on Docker Container

Prerequisite 🔥

  • Docker installed.

Step-1)Create one Dockerfile

  • Install python and some basic tools.
FROM centos
RUN dnf install python36 -y
RUN dnf install net-tools vim which -y
  • Build Dockerfile
docker build -t IMAGE_NAME .

Step-2)Run above the docker container.

docker run -it --name NAME_OF_CONTAINER IMAGE_NAME

Output

  • Running the python code.
Python Code
python3 FILENAME.py

--

--

--

DevOps/Cloud Enthusiast

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

This Week in Accessibility: What we can learn from the “WebAIM Million”

Webscraping Spotify reviews using ‘rvest’ in R

How to setup Alfa card on Kali VM!!!

5 must-have command line Kubernetes tools

Top iOS Trends to Decide the Future of App Development

Top 5 CSS Framework 2020

How i horizontally scaled my Laravel app on DigitalOcean

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
Ritesh Singh

Ritesh Singh

DevOps/Cloud Enthusiast

More from Medium

Python Mutation Testing with Cosmic-Ray

Setting up Python Interpreter and running Python Code on Docker Container

The Quick And Basic Use Of Logging Module In Python

File Handling and Operations in Python