Introduction to Docker

November 18, 2016 | Views: 6713

Begin Learning Cyber Security for FREE Now!

FREE REGISTRATIONAlready a Member Login Here

Hi Readers,

In this blog post, I’ll introduce you to the world of containerisation – Docker.

Topic

Introduction to Docker

Target Audience

Beginners

What you’ll learn

  • Why docker

  • Difference between Docker and Virtualisation

  • Spinning up a ubuntu instance in docker container

Why Docker?

Imagine this scenario, I wanted to deploy my application named ( testapp ) in the production environment. I hand over my code to the ops guy for the deployment. Wait, here is the catch. Now the ops guy comes back to you saying that your code doesn’t work in the production environment. And now the developer blames the ops guy.

1

This is because your dev environment ( where you wrote and tested your code)  is different from the production environment. Dev environment is also different from the testing environment. There may be many reasons for the failure of the code. It may be due to 3rd party dependency, version error etc., Don’t  you think we need a common environment in which every team can work trusting that their code with always run. Docker comes to the rescue. Docker creates that “common” environment ( docker images ) and each team can run their own instances ( docker containers ).

We may have to install many dependency tools. And remember, we can’t spend more time on installing those 3rd party tools and resolving all dependency or version error that may occur. We want to build, deploy and run in “hours. ( Note the double quotes on hours ). Gone are the days, where you wait for 3 months for a release to happen.

Difference between Docker and Virtualisation

VM’s and containers work almost the same. The main difference being the absence of Hypervisors ( Like Hyper-V) in containers. The containers don’t need a guest OS, instead, they sit on the base OS. This is achieved by use of Docker Engines. To understand better, you can think of Docker Engines like the bytecodes in java. It is platform independent. You can always run a container if you have docker engine installed.

2

Spinning up a ubuntu instance

You can download docker from their official website – https://www.docker.com/

Once you have the set up ready, check if the docker is installed using the following command

docker

3

As you can see, docker is installed. Now we need to download ubuntu image from the docker hub. Docker hub is where all your docker images are hosted. It is similar to GitHub. You can have public and private images as well.

docker search ubuntu

4

And pull any of the ubuntu installation using the following command

docker pull ubuntu ( image name )

Once you have installed your image. You can check the list of available images using the following command

docker images

5

As you can see, It list all my docker images and the date at which it is created. We are interested in spinning up a ubuntu machine. Use the following command

docker run -i -t ubuntu bash

6

As you can see, I’m inside the ubuntu machine. Now imagine this ubuntu machine to be your test app. Now you can deploy this app to your dev, test, and prod environment. Everything remains the same and the code will run without any error. You can reap the benefits of containerization feature in docker and apply to your security field – DevSecOps. Hope you understood the importance of docker. Please feel free to suggest any comments.

Refer to my blog for more updates on docker and application security.

http://www.tutorgeeks.net/2016/11/introduction-to-docker.html

Thanks and Regards,

Vinoth Kumar

Share with Friends
FacebookTwitterLinkedInEmail
Use Cybytes and
Tip the Author!
Join
Share with Friends
FacebookTwitterLinkedInEmail
Ready to share your knowledge and expertise?
5 Comments
  1. thanks for the information

  2. Hi,

    If in case the developer makes changes in the app so will the changesin the same app be reflected to testing team too.

  3. nice explain in short

  4. Good to know, thanks for sharing

Comment on This

You must be logged in to post a comment.

Our Revolution

We believe Cyber Security training should be free, for everyone, FOREVER. Everyone, everywhere, deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is a free community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

Support Cybrary

Donate Here to Get This Month's Donor Badge

 
Skip to toolbar

We recommend always using caution when following any link

Are you sure you want to continue?

Continue
Cancel