Introduction to Docker, Docker containers & Docker Hub
Docker:
Docker can be understood as being a tool that makes creating, deploying, and running applications easier with the use of containers. Now, what are containers? These can be described as something that makes it possible for developers to spruce up an application with all the parts needed for it. These could include libraries, for instance, along with other dependencies. Docker assembles all these and presents them as one package. The container gives the developer the assurance that the application will run on just about any Linux machine, no matter to what extent any of its customized settings in a particular machine could be at variance from those on the machine on which the code is written and tested.
Visit the link to learn Docker basics and installation.
Who is Docker for:
Docker is aimed at the benefit of both developers and system administrators. This makes it a part of many DevOps (developers + operations) toolchains. The main benefit that Docker carries for developers is that they can concentrate on their core job of writing the code without having to bog themselves down with which system it will run on.
How docker is useful in the IT industry:
The most vital use of the Docker Enterprise container platform is that it offers value to a business by drastically bringing down its cost on infrastructure and maintenance. It can also do the same when it comes to migrating current. Best of all, all these can be done immediately upon installation. In this way, it saves time, as well. The following infographic illustrates how Docker brings down costs and increases productivity in an enterprise:
Image source: https://www.docker.com/why-docker
Docker container:
Next, let us get down to get to understand what a container in a Docket is. We can think of it as being a standard unit of software that has the purpose of packaging the code and all its dependencies together.
It comes with all that an application needs to run, namely settings, code, system tools, runtime, and system libraries.
The point of making a Docker container in this fashion is to help the application run in a fast and dependable manner between one computing environment and another. A Docker container image has these characteristics:
- Lightweight
- Standalone
- Executable
In this sense, the container lies at the heart of a Docker.
Docker containers that run on Docker Engine:
Let us get down to understanding the Docker containers that power the Docker Engine.
Standardization: Docker containers were created according to the industry standard for containers. The aim of doing this is that the containers could be made portable
Lightweight: Since containers share the machine’s OS system kernel; there is no need for an OS per application. What does this do? It increases server efficiencies and brings down the costs of the server as well as those associated with licensing
Security: Security is assured for applications in containers. It is a fact that Docker comes with the industry-best default isolation capabilities.
Let us explain a few Docker commands from the architecture shown above:
- docker run – Used for running a command in a new container
- docker start – For starting one or more stopped containers
- docker stop – For stopping one or more running containers
- docker build – Used for building an image form in a Docker file
- docker pull – For pulling an image or a repository from a registry
- docker push – Given for pushing an image or a repository to a registry
- docker export – For exporting a container’s filesystem as a tar archive
- docker exec – To run a command in a run-time container
- docker search – For searching the Docker Hub for images
- docker attach – To attach to a running container
- docker commit – For creating a new image from a container’s changes
- docker daemon – Having listened for Docker API requests, the Docker daemon (dockerd) manages Docker objects. These include networks, volumes, containers, and images. It also communicates with other daemons when managing Docker services.
- docker Images – A read-only template, an image has instructions that are used to create a Docker container. Many times, images are based on other images and carry some degree of customization. An image-based on ubuntu can install the Apache web server, your application, and the configuration details that the application needs to run.
Understanding Docker Hub Registry
A registry service that is cloud-based; the Docker Hub Registry allows the user to do the following:
- Link to code repositories
- Build images and test them
- Stores images that are manually pushed
- Links to Docker Cloud to help deploy images to a host.
In summary, we can understand the Docker Hub Registry as a tool that offers a centralized resource for discovering a container image, managing distribution and change, facilitate collaboration between the user and team, and automate workflow throughout the development pipeline.
Ref URL: https://docs.docker.com/docker-hub/
- Create a docker hub account in https://hub.docker.com/
- Pull a docker image
docker pull ubuntu
- pull a docker image with old version
docker pull ubuntu:16.04
- create a custom tag to docker image
docker tag ubuntu: latest admin/ubuntu: demo
- login to your docker hub registry “sh docker login
- docker push admin/ubuntu: demo
testing
- Remove all images in docker server
docker image rm -f <Image_id>
- Pull your custom image from your docker account
docker pull admin/ubuntu:demo
Installation Docker on Amazon Web Services (AWS) cloud:
Why Amazon Web Services:
AWS is a highly preferred cloud service. It enjoys a position of primacy in the global cloud services market due to the following reasons:
- Market pioneers
- Unshakeable customer faith
- Cost-effectiveness
Ease and affordability of building a storage system with no worry of estimating usage Suitability for small businesses, since it is ideal for building a business from bottom to top.
Advantages of AWS:
- Easy of usability
- Agility
- Security
- Reliability
- Services without capacity limits
- Cost-effectiveness
- Flexibility
- 24×7 support.
For more information to learn DevOps tools integration visit here.
Steps to Install docker on Amazon Linux:
- We need Amazon web services account “https://aws.amazon.com”.
- Create Aws account and login to console. Choose Ec2 service from console.
- Click on Launch instance and choose Amazon Linux Ami Ec2 server free tier Eligible.
- Choose free tier Eligible Ec2 t2. Micro.
- Here we need configure instance details like region, subnets, vpc.
- Add storage By default it will give us 8GB we can modify it after launching Ec2.
- Create security groups and check port 22 is open to allow SSH connection and we can add incoming ports in security groups.
- Review details of Ec2 instance and click on Launch.
- Create New key pair or if we have existing key pair, we can use same and download and click on Launch instance.
- Convert Keypair from .PEM file to. PPK using puttygen. We can Download puttygen and putty from here “ https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html”.
- Login ec2 instance using putty and Ec2 Public Ip address.
- Click on SSH in Right panel and click Auth and add PPK key pair for ec2 to login.
- When we login to ec2 with New key pair we will get security, alert click on YES and login as “Ec2-user”. If we need to login as root “sudo su – “.
- Update packages for security purpose using command “sudo yum update -y”.
- Now we need to install docker on Amazon Linux. Use command “ sudo yum install docker -y”.
- To check Docker version, we can see output below:
- start docker with “sudo service docker start” command.
- check Docker status.
- Now we can download any docker images by using “docker pull command”.
- check docker container is running with “docker ps” command.
- To Login into docker container use “docker exec -it –user root container id bash.
- check current docker containers and stopped container with “docker ps -a” command.
- To check downloaded docker images with “docker images” command.
Conclusion:
A tool with which creating, deploying and running applications is made much easier, a Docker is a set of packages that uses containers. It is of high value to both developers and system administrators, who can look at their core work without having to worry about writing the code, which runs on any system.
Docker Enterprise if of immense value to the IT industry, as it brings down the maintenance and infrastructure costs. It can be deployed immediately and can be migrated easily.
Written by Jagadeesh
I¦ve been exploring for a little for any high quality articles or blog posts on this kind of house . Exploring in Yahoo I at last stumbled upon this website. Reading this information So i¦m satisfied to show that I’ve a very excellent uncanny feeling I found out exactly what I needed. I most undoubtedly will make sure to do not fail to remember this website and provides it a look on a relentless basis.
I really appreciate your work, Great post.
Appreciate it for helping out, excellent information. “The surest way to be deceived is to think oneself cleverer than the others.” by La Rochefoucauld.
I discovered your blog site on google and check a few of your early posts. Continue to keep up the very good operate. I just additional up your RSS feed to my MSN News Reader. Seeking forward to reading more from you later on!…
I don’t normally comment but I gotta state thanks for the post on this amazing one : D.
Some genuinely good posts on this internet site, thanks for contribution.
Woah! I’m really enjoying the template/theme of this blog. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and visual appearance. I must say you’ve done a great job with this. Additionally, the blog loads very quick for me on Internet explorer. Outstanding Blog!
I have been surfing online greater than three hours lately, yet I never discovered any fascinating article like yours. It?¦s lovely value enough for me. In my opinion, if all web owners and bloggers made excellent content material as you did, the web will be a lot more useful than ever before.
Wow, fantastic blog format! How long have you ever been running a blog for? you make blogging glance easy. The entire look of your website is wonderful, let alone the content!
Hi there, I found your blog by the use of Google at the same time as searching for a related topic, your site got here up, it seems to be good. I have bookmarked it in my google bookmarks.
We are happy to have helped. Do check out our other blogs on the various tools used for DevOps, you will definitely find it interesting! 🙂
Does your website have a contact page? I’m having trouble locating it but, I’d like to send you an email. I’ve got some suggestions for your blog you might be interested in hearing. Either way, great blog and I look forward to seeing it develop over time.
Keep working ,fantastic job!
I believe this site has some rattling good info for everyone :D. “The test of every religious, political, or educational system is the man that it forms.” by Henri Frdric Amiel.
Some really fantastic blog posts on this web site, thanks for contribution. “The spirit is the true self.” by Marcus Tullius Cicero.
Very interesting subject, regards for posting.
It’s hard to find knowledgeable people on this topic, but you sound like you know what you’re talking about! Thanks
I love your writing style truly enjoying this internet site.
I genuinely enjoy examining on this web site, it holds excellent content. “The living is a species of the dead and not a very attractive one.” by Friedrich Wilhelm Nietzsche.
You really make it seem so easy with your presentation however I in finding this matter to be actually something which I believe I would by no means understand. It seems too complicated and extremely large for me. I am having a look ahead to your subsequent submit, I will attempt to get the hang of it!
Hello.This post was extremely interesting, especially since I was browsing for thoughts on this matter last Thursday.
Great write-up, I am normal visitor of one¦s site, maintain up the excellent operate, and It’s going to be a regular visitor for a lengthy time.
Perfectly indited subject matter, Really enjoyed looking through.
Perfectly indited subject matter, Really enjoyed reading.
I really enjoy studying on this internet site, it holds great articles. “The living is a species of the dead and not a very attractive one.” by Friedrich Wilhelm Nietzsche.
Hi, I think your blog might be having browser compatibility issues. When I look at your website in Firefox, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, great blog!
Hi, please upgrade you internet explorer.please clear browser cache and do some compatibility view setting in Internet explorer. May i know which windows version you are using currently. please follow Link “https://support.microsoft.com/en-in/help/17472/windows-internet-explorer-11-fix-site-display-problems-compatibility-v”. Thank you
Hello There. I found your blog using msn. This is an extremely well written article. I will be sure to bookmark it and return to read more of your useful information. Thanks for the post. I will definitely comeback.
You have remarked very interesting details! ps decent site. “Great opportunities to help others seldom come, but small ones surround us every day.” by Sally Koch.
I really appreciate this post. I have been looking everywhere for this! Thank goodness I found it on Bing. You’ve made my day! Thanks again
Excellent blog here! Also your site loads up very fast! What web host are you using? Can I get your affiliate link to your host? I wish my website loaded up as fast as yours lol
Of course, what a great website and educative posts, I definitely will bookmark your website.All the Best!
Good blog! I really love how it is easy on my eyes and the data are well written. I’m wondering how I might be notified whenever a new post has been made. I’ve subscribed to your feed which must do the trick! Have a nice day!
Hiya, I am really glad I have found this info. Today bloggers publish only about gossips and internet and this is really irritating. A good website with interesting content, that’s what I need. Thank you for keeping this site, I will be visiting it. Do you do newsletters? Can not find it.
Some really fantastic work on behalf of the owner of this website , dead great written content.