Start a Project

Start your journey with Docker….!!!

Let’s talk about Docker. As you have read in earlier blogs.

What exactly docker is?

Now let’s talk about the next question, What makes Docker so attractive & how does it work ??

Around 10 Years ago, when the virtual machines started, we realized that virtual machines shared the same hardware with the base machine.

The goal of virtual machines was to ensure that if one failed, then it wouldn’t impact the host. Additionally, they provided isolated environments for various applications.

In short, a virtual machine is a resource through which we can create an elusion for the app that has its own environment.

But even at that time base machine had an enormous load of various virtualized machines, to overcome this situation a new application was launched named ‘docker’.

It is a very lightweight application and shares the kernel with the base machine in other words it virtualized the environment rather than virtualizing a machine.

The main thing I would like to share with you is we have to install the Docker application and then we can run 10-15 containers or more than that on the single base machine without any problem.

Like in our Laptop, we can’t install 10-15 virtual machines as various applications need their own environment.

So, on your laptop, if there is docker installed, then you can work very easily anywhere around the world. However, It does not have any dependency issues.

Docker containers can use their own ports, allowing two containers with Apache on port 80 to run on different ports simultaneously.

[DOCKER IN DOCKER’s TERM…]

BUILD ONCE, CONFIGURE ONCE & RUN ANYWHERE……..

There is also one more component in docker DOCKER INDEX….

You must be thinking about what the Docker index is.

Let’s talk about the docker index, it is basically a git repository that contains docker containers and all. You can push containers in that repository or pull containers just like git.

These all points make Docker so attractive….

Now let’s talk about how does docker work?

Let me tell you one thing Docker’s commands are too simple and user-friendly. You only just need to understand the flow of its commands.

ok, let’s install docker in your ubuntu os machine….

First, open the terminal and go to the root user by typing:

then update your system by typing:

Now check curl if it is not installed then type:

Get the latest Docker package with the mentioned command:

now verify whether the Docker is installed or not, type:

docker version should be 20.10.22.

[Note: you can get lots of ways to install docker in just a few commands but to install an updated version, follow the procedure.]

Now let’s learn how to run the docker

First, you have to download the docker’s image like I want to download the ubuntu-20.04 image then download it by typing:

it will pull the image from the dockerhub

After pulling it, you can list the images by typing:

Then, it will show you the complete downloaded images that you have in your system

after that just hit the command to use docker’s image:

The command gives you a terminal to run or install anything. To save changes, you must commit the container by opening another terminal and typing as the root user:

now the question arises how do we get to know the container’s ID & container’s name?

Here, you can check your container’s ID and name by typing:

after committing it, your container is ready to use.

[ Note: Remember, don’t exit or run another container without committing your changes, or you’ll lose your work. Use docker commit to save your changes. ]

now if you want to run your container in daemonize mode then you have to hit the command:

To stop running the container:

To remove the container:

 All basic commands are:

Terminologies –

In the next blog, you can learn how to host a website on a Docker container.

You may also visit our Magento development services and quality  Magento 2 Extensions.

For further help or queries, please contact us or raise a ticket.

Exit mobile version