Docker - An Introduction

Embed Size (px)

Citation preview

Docker


Prashant Goel
Software Consultant
Knoldus software LLP

Agenda

Introduction to Docker

Why docker?

Docker Benefits

Docker Core Components

Docker Workflow Components

Docker Vs Virtual Machine

Demo

What is docker?

Docker

Dockeris anopen-sourcecontainer based technology.

It automates the deployment ofapplicationsinsidesoftware containers.

It provides an additional layer of abstraction and automatization ofoperating systemlevel virtualizationonLinux.

It is an open platform for developers and system admins to build, ship, and run distributed applications.

BuildDevelop an app using Docker containers with any language and any tool chain.

ShipShip the Dockerized app and dependencies anywhere - to QA, teammates, or the cloud - without breaking anything.

RunScale to 1000s of nodes, move between data centers and clouds, update with zero downtime and more.

Docker

Build any app in any language using any stack

Dockerized apps can run anywhere on anything

Unites Developers and SysAdmins in the fight against those pesky dependency demons!

Why Docker ?

Scalabe

Portable

Deployment

Density

Docker Benefits

Docker Core components

Docker DAEMON
- Docker Engine, runs on the host machine

Docker CLIENT
- Client used to interact with the DEAMON

Docker Workflow

Docker IMAGE
- Holds the environment and your application
Docker CONTAINER
- Created from images. START, STOP, MOVE, DELETE
Docker REGISTRY
- Public and private repositories used to store images
Docker FILE
- Automates image construction

To setup an Automated BuildCreate a Docker Hub account and login.Link your GitHub or Bitbucket account through the Link Accounts menu.Configure an Automated Build.Pick a GitHub or Bitbucket project that has a Dockerfile that you want to build.Pick the branch you want to build (the default is the master branch).Give the Automated Build a name.Assign an optional Docker tag to the Build.Specify where the Dockerfile is located. The default is /.Once the Automated Build is configured it will automatically trigger a build and, in a few minutes, you should see your new Automated Build on the Docker Hub Registry. It will stay in sync with your GitHub and Bitbucket repository until you deactivate the Automated Build.

Docker Vs Virtual Machine

Docker separates applications from infrastructure using container technology, where as virtual machine separate the operating system from bare metal.

Virtual Machine

Docker

AuFS is a layered file system, so you can have a read only part, and a write part, and merge those together. So you could have the common parts of the operating system as read only, which are shared amongst all of your containers, and then give each container its own mount for writing.

So let's say you have a container image that is 1GB in size. If you wanted to use a Full VM, you would need to have 1GB times x number of VMs you want. With LXC and AuFS you can share the bulk of the 1GB and if you have 1000 containers you still might only have a little over 1GB of space for the containers OS, assuming they are all running the same OS image.

What docker does is it gives you the ability to snapshot the OS into a common image, and makes it easy to deploy on other docker hosts. Locally, dev, qa, prod, etc, all the same image.This is great for unit testing, lets say you have 1000 tests and they need to connect to a database, and in order to not break anything you need to run serially so that the tests don't step on each other (run each test in a transaction and roll back). With Docker you could create an image of your database, and then run all the tests in parallel since you know they will all be running against the same snapshot of the database. Since they are running in parallel and in LXC containers they could run all on the same box at the same time, and your tests will finish much faster. Try doing that with a full VM.

Thank You