Setting up Python on Docker Container

Setting up Python on Docker Container

In the following article we're going to set up Python Interpreter and run python code on a Docker container. For this practical we've to make sure that the docker service must be running.

Docker is already installed and running

No alt text provided for this image

Setting Up Python

Step 1 : Launch the Docker container with centos image

docker run -it --name mypythonos centos:latest
No alt text provided for this image

To check the running containers,

No alt text provided for this image

Step 2 : Install python3 software in the docker container

yum install python3 -y
No alt text provided for this image

To check the version of python 3 software,

No alt text provided for this image

Step 3 : Write Python code in the container

  • Using Python3 REPL Live Interpreter .
No alt text provided for this image
  • Write a Python code inside a file.
No alt text provided for this image

From this we can see that we can easily run the Python code inside the Docker container.


***** THANK YOU FOR READING!! *****



要查看或添加评论,请登录

Khushi Garg的更多文章

  • Industrial Use-cases of Ansible

    Industrial Use-cases of Ansible

    What is Ansible? Ansible is an automation software tool that provides simple but powerful Automation for cross-platform…

  • Benefits that MNC’s are getting from AI/ML

    Benefits that MNC’s are getting from AI/ML

    What is Artificial Intelligence? Artificial Intelligence is the simulation of human intelligence to the machine that is…

    2 条评论
  • Building Basic AWS Cloud Infrastructure using AWS CLI

    Building Basic AWS Cloud Infrastructure using AWS CLI

    TASK DESCRIPTION : Create the following using AWS CLI: Create a key pair Create a security group Launch an instance…

  • Configuring HTTPD Server on Docker Container

    Configuring HTTPD Server on Docker Container

    In the following article we are going to configure the HTTPD server on the Docker container. In this practical we're…

  • KUBERNETES - A Container Management tool

    KUBERNETES - A Container Management tool

    What is Kubernetes ? Kubernetes is an open-source Container-Orchestration system software for automating Deployment…

    2 条评论
  • DOCKER AUTOMATED USING ANSIBLE

    DOCKER AUTOMATED USING ANSIBLE

    To configure and start Docker services and configure Apache Webserver on it using Ansible playbook. TASK DESCRIPTION :…

    4 条评论
  • UNILEVER Case Study - AWS

    UNILEVER Case Study - AWS

    This Article shows the case study of Global Cloud Leader that is Amazon Web Services ( AWS ) Cloud . In this we'll see…

    2 条评论
  • "BIG DATA": Problems, solutions and its management!

    "BIG DATA": Problems, solutions and its management!

    "Over 2.5 quintillion bytes of data is created every single day, and it’s only going to grow from there.

    5 条评论
  • Deploying WordPress on Google Cloud Platform by integrating various GCP services..

    Deploying WordPress on Google Cloud Platform by integrating various GCP services..

    Hello Readers! This is my Google Cloud Platform task by integrating all those things which I've learnt in my two days…

    5 条评论
  • Google Cloud Platform (GCP)

    Google Cloud Platform (GCP)

    This article talks about all the services in Google Cloud Platform which I learnt from 2 days of workshop organised by…

社区洞察

其他会员也浏览了