Docker is an open-source container based technology.
It automates the deployment of applications inside software containers.
It provides an additional layer of abstraction and automatization of operating system–level virtualization on Linux.
It is an open platform for developers and system admins to build, ship, and run distributed applications.
8. Docker Core components
Docker DAEMONDocker DAEMON
- Docker Engine, runs on the host machine- Docker Engine, runs on the host machine
Docker CLIENTDocker CLIENT
- Client used to interact with the DEAMON- Client used to interact with the DEAMON
9. Docker Workflow
Docker IMAGEDocker IMAGE
-- Holds the environment and your applicationHolds the environment and your application
Docker CONTAINERDocker CONTAINER
-- Created from images. START, STOP, MOVE, DELETECreated from images. START, STOP, MOVE, DELETE
Docker REGISTRYDocker REGISTRY
-- Public and private repositories used to store imagesPublic and private repositories used to store images
Docker FILEDocker FILE
-- Automates image constructionAutomates image construction
10. Docker Vs Virtual Machine
DockerDocker separates applications from infrastructure using containerseparates applications from infrastructure using container
technology, where astechnology, where as virtual machinevirtual machine separate the operatingseparate the operating
system from bare metal.system from bare metal.
To setup an Automated Build
Create 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.
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.