Skip to main content

what is docker?

Prelogue:

I was hearing about kubernetes application in cloud for quite a bit of time now and have been feeling low about not understanding what kubernetes is. So I headed over to linkedin learning, the awesome platform to learn about kubernetes. But kubernetes courses showed understanding of docker as a pre-requisite. So I started to learn about docker.

Introduction:

                               Photo by Andy Li on Unsplash

In this post, I want to provide you a preliminary understanding of what is docker and a container; and maybe a basic introduction of few usage and concepts. This is the first part of the learn-docker series I am writing, along with my own learning curve in understanding docker, container, containerization and other processes. Now let's get started with our learning.

what is docker?

Docker is a utility which carves up your computer into small sealed containers which are isolated from outside worlds. It contains its own code, env and all. It also builds these containers for you. It gets the code to and from you. It also opens you up to a social platform where you can find such containers and work on them.

what is a container?

it is a bundle of self sufficient software. it contains everything needed to run on its own. including:

(1) code (2) config files (3) dependencies installed (4) processes (5) networking for talking to other containers (6) even the part of operating system it needs to run

so basically docker takes your code and env and all resources as mentioned and seals it into a container. As well as docker runs multiple such containers in its carved up places, manages the server; and finally tears the whole thing down when work is done. 

Installing docker-ce in your machine:

If you are using mac or pc, then you have to install docker desktop. Follow this official link for downloading docker desktop. In case of linux machines, it is easy to install docker from terminal using repository method. Follow this official link to get it installed. There can be some problems for download. Follow this stackoverflow discussion.

One and first use of docker:

Not many people let's say use linux machines all the time. So what they may do is that they will run a linux virtual machine using docker. Now you may think that docker is the vm but no. Docker is the software which hosts and holds that vm in your machine and runs it. we will run a small docker program named hello-world.

Troubleshoot:

It may have been the case that you got an error something similar to this:

docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.
follow this link, if you don't want to use simple solution of adding sudo before your statement. The risk in the following of the solution mentioned in stackoverflow is that you may have to reboot or log off from your machine; which maynot be a very good choice for you. 

Whatever, you must have solved the docker issue and now you must have run the command:

sudo docker run hello-world

This, if your docker doesn't have hello-world downloaded, then will fetch from remote and download, then run. The sign that it has run is the message

"hello from docker!" which pops up in your console.


 The same thing can be done writing the command in a mac terminal if you are using the mac or if you are using windows then in your command prompt. If you are facing a socket not found or related issue in mac, then see if your docker desktop is running completely. If it is, it will show that in the top right corner icon. 

Now to see a collection of basic usage and commands of docker; write $docker in your terminal. something like this will come up:


 If you write $docker info (or sudo docker info for non-root users),then all client and server descriptions and informations will come up.


what is docker id?

 I will finish this introductory part by saying one more thing. Docker comes with a online portal too. You can host unlimited public repository  and one private repository to host your docker images; using free docker id. You can think about it as a github like platform but for docker images and containers. You should build your docker id now as later on we'll create images and upload them in public repositories in our docker accounts.

Note this, docker id may sound like something you need to find and enter; but docker id is just the username you put. So give a fancy docker id as you wish!

Our next post on this series focuses about docker images.It is yet to come. I am loosely following the learning from linkedin learning's Arthur ulfeldt's course. I will highly recommend his course along side my documents. Thanks for reading! leave a comment below if you like the content!

Comments

Popular posts from this blog

Mastering SQL for Data Science: Top SQL Interview Questions by Experience Level

Introduction: SQL (Structured Query Language) is a cornerstone of data manipulation and querying in data science. SQL technical rounds are designed to assess a candidate’s ability to work with databases, retrieve, and manipulate data efficiently. This guide provides a comprehensive list of SQL interview questions segmented by experience level—beginner, intermediate, and experienced. For each level, you'll find key questions designed to evaluate the candidate’s proficiency in SQL and their ability to solve data-related problems. The difficulty increases as the experience level rises, and the final section will guide you on how to prepare effectively for these rounds. Beginner (0-2 Years of Experience) At this stage, candidates are expected to know the basics of SQL, common commands, and elementary data manipulation. What is SQL? Explain its importance in data science. Hint: Think about querying, relational databases, and data manipulation. What is the difference between WHERE ...

What is Bort?

 Introduction: Bort, is the new and more optimized version of BERT; which came out this october from amazon science. I came to know about it today while parsing amazon science's news on facebook about bort. So Bort is the newest addition to the long list of great LM models with extra-ordinary achievements.  Why is Bort important? Bort, is a model of 5.5% effective and 16% total size of the original BERT model; and is 20x faster than BERT, while being able to surpass the BERT model in 20 out of 23 tasks; to quote the abstract of the paper,  ' it obtains performance improvements of between 0 . 3% and 31%, absolute, with respect to BERT-large, on multiple public natural language understanding (NLU) benchmarks. ' So what made this achievement possible? The main idea behind creation of Bort is to go beyond the shallow depth of weight pruning, connection deletion or merely factoring the NN into different matrix factorizations and thus distilling it. While methods like know...

Spacy errors and their solutions

 Introduction: There are a bunch of errors in spacy, which never makes sense until you get to the depth of it. In this post, we will analyze the attribute error E046 and why it occurs. (1) AttributeError: [E046] Can't retrieve unregistered extension attribute 'tag_name'. Did you forget to call the set_extension method? Let's first understand what the error means on superficial level. There is a tag_name extension in your code. i.e. from a doc object, probably you are calling doc._.tag_name. But spacy suggests to you that probably you forgot to call the set_extension method. So what to do from here? The problem in hand is that your extension is not created where it should have been created. Now in general this means that your pipeline is incorrect at some level.  So how should you solve it? Look into the pipeline of your spacy language object. Chances are that the pipeline component which creates the extension is not included in the pipeline. To check the pipe eleme...