top of page
Search
understandingdevop

What is Docker?

Now almost all industries are trying to adopt a microservices architecture, which means containerization technology. Docker provides a platform where you can build, and run the containers. You can simply run your applications without installing the whole operating system.


In virtualization, you need to create a whole virtual operating system that will install all the libraries, kernel and then after that, you deploy your application on that operating system and do your stuff.


In containerization, you only need to install docker daemon on your host operating system. Yes that's all, the best part of the docker container is, it shares the kernel of an underlying host operating system.

Docker containers consist of libraries, binaries, with your application package. Though it shares the kernel with the underlying host operating system, applications running on the host operating system can't talk to docker containers directly because containers run in an isolated environment. You can make this happen by configuring multi-host overlay networking. Docker containers running in an isolated environment also adds the security layer to your infrastructure.


We can run containers on physical servers as well as VMs. Also now docker Linux containers can run on windows platform with the Hyper-V technology.



First of all install docker so that you can run docker commands to create containers, pull the images.

Let's say I want to run an Nginx web server on Docker containers.

Steps:-

docker pull nginx (this command will pull the nginx container from the official docker hub repository)


docker run -d -p 80:80 nginx (this command will run your docker container with the nginx image which you have pulled in the previous step, talking about options -d is used for running my container in daemon mode and -p option is used for exposing the port you want to expose on the host. (HOST port:CONTAINER port). That means if you have now used this command to run your container you can access your nginx container from your host machine with your host machines IP address or localhost. If you do curl -I localhost(by default port is 80 for Http request) you will get the response from the nginx container running on your host.


Once you run above command, your nginx container will be up and running, you can check that with the below command:-

docker ps

This command will list you the running containers on your host.

And cheers you can access your nginx web server (which is hosted on the docker container) from your browser.


21 views0 comments

コメント


Post: Blog2_Post
bottom of page