Pulling Docker Image and adding python to it :-

Garvit Garg
3 min readJun 10, 2021

Hey guys in this blog we are gonna see how to :

  1. Pull a docker image from docker-hub and create a new container
  2. Install python on top of that container
  3. Copying/Creating ML model created in jupyter notebook

For doing so we need an OS, so we are using Redhat Linux as our base OS

So lets start with first step which is :

Creating Container Image :

Now to install docker container we can either use manual installing command “rip” or we can configure “yum” command which will automatically download all the required things for installing docker properly in your system.

CMD : yum install docker

Now lets check the status of our docker system.

Now as we have docker installed in our system our next step is to pull docker image. we are gonna use cent-OS docker image.

Pulling of image is done. Now next step is to create our own container.

By use of above code we can create new container.
Our container is ready, now our next step is to download python inside the container but for that we have to firstly download the vim editor inside container.

For that we use CMD : yum install vim -y

Now our next step is to download python in our container.

Our python is installed but for using ML in it we have to download few libraries :
yum install numpy
yum install pandas
yum install scikit-learn

After completing all these setup our system is ready to copy file from our ML model.
For that command :
docker cp Model_name Container_name :/ Location

Now open the vim editor and create the model and run it.

Thank You

--

--