Basic Docker Container

Basic Docker Container

Hi there! Today we are going to see some basic docker containers.

What is Docker?

High-level-overview-of-Docker-architecture.png

Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and deploy it as one package. By doing so, thanks to the container, the developer can rest assured that the application will run on any other Linux machine regardless of any customized settings that the machine might have that could differ from the machine used for writing and testing the code.

Let's Start

In this blog what we will do is that we will create our own docker image with the help of Dockerfile. Dockerfile is a way to customize the pre-created images or create your own image from scratch.

In this image, we will install python and some machine learning libraries of python so that we can run our pre-made model in it.

Our Dockerfile looks like this.

Screenshot (1210).png

and we can build images using the docker build command.

VirtualBox_Ansible Controller Python_01_06_2021_00_04_41.png

Our prediction program looks like this

VirtualBox_Ansible Controller Python_01_06_2021_00_06_02.png

Now we can launch our container using docker run command and pass the program name and value we need to predict in a single command like this

VirtualBox_Ansible Controller Python_01_06_2021_00_07_21.png

So as you can see we have successfully run the container and program inside it.That's it for this one. See you next time ....!!!

Did you find this article valuable?

Support Written Wisdom by becoming a sponsor. Any amount is appreciated!