Skip to main content

Command Palette

Search for a command to run...

Basic Docker Container

Updated
2 min readView as Markdown
Basic Docker Container
S

I am a learner who likes to get behind the new technologies of the world and integrate them for a more efficient workflow. Currently learning AWS, GitOps, Kubernetes, and much more...

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 ....!!!

29 views

More from this blog

Written Wisdom

35 posts

I'm a 22-year-old boy with a passion to learn about the DevOps Landscape. I love to explore things and deep dive into how these little pieces of code come together to form such state-of-the-art tools.