Docker - Fundamental
Blackie
2015.10.15
What is docker
what can docker do
Docker hands on
problems
WHAT IS DOCKER
Build, Ship, Run
An open platform for distributed applications for developers and sysadmins
Docker uses resource isolation features of the Linux kernel.
Docker allows you to package an application with all of its dependencies into a standardized unit for
software development
Lightweight
Open
Security
How to work with Linux Kernal
Different from VM
Containers have similar resource isolation and allocation benefits as virtual machines but a different
architectural approach allows them to be much more portable and efficient.
Dockerfile
Docker can build images automatically by reading the instructions from a Dockerfile.
A Dockerfile is a text document that contains all the commands a user could call on the command line to
assemble an image.
Using docker build users can create an automated build that executes several command-line instructions in
succession.
Sample of Redis
https://docs.docker.com/examples/running_redis_service/
Docker Hub
The Docker Hub is a cloud-based registry service for building and shipping application or service containers.
https://hub.docker.com/
Docker and GitHub
Docker with AWS
Docker Containers on AWS
Docker with Azure
Quick Start: Windows Server Containers and Docker
WHAT CAN DOCKER DO
Docker User Cases
Benefits from Docker
Accelerate Developer Onboarding
Empower Developer Creativity
Eliminate Environment Inconsistencies
Easily Share and Collaborate on Applications
Ship More Software Faster
Quickly Scale
Easily Remediate Issues
Scenario : New Comer on Board(Now)
Install VS
Prepare development environment
Install DB(MSSQL, Oracle)
Install IIS feature
Install Redis, MongoDB
Install Jenkins
Install Task runner(Grunt/Gulp)
Install other(NodeJS, Nginx, Elastic Search, etc…)
Start domain training
It is Annoying…
Scaenario : New Comer on Board(Docker)
Install VS
Docker Install & Run
Start domain training
Faster and more Simple
Scenario : Continuous Integration (Now)
Commit code to DEV SVN
Build DEV SVN
Test in DEV SVN
But Broken another function or some urgent issue interrupted development
WTF…
Scenario : Continuous Integration (Docker)
Develop in Local
Build in Local
Test in Local
Consistent the
tools and environments
DOCKER HANDS ON
Docker Training
https://training.docker.com/
Docker on Windows
Windows Server 2016 and System Center 2016 support
Windows Server Container
Boot2Docker(for Windows & Mac)
Lightweight Linux distribution based on Tiny Core Linux made
specifically to run Dockercontainers.
RAM, weighs ~27MB
Boots in ~5s
Docker Toolbox
Required
Enable Virtualization Technology on Bios
Install Git(Docker Toolbox including it)
Download Docker Toolbox
Docker terminal
Kitematic(GUI tool)
First launch Docker terminal or Kitematic have problem please remove default VM and create a new one
1. docker-machine rm default
2. docker-machine --native-ssh create -d virtualbox
Play with Docker Toolbox - Docker terminal
1. Create a Docker container from Dockerfile
2. Build Instance
docker build -t <your username>/redis .
3. Run the service
docker run --name redis -d <your username>/redis
Docker terminal
Play with Docker Toolbox - Kitematic
1. Open Kitematic(Docker GUI tool)
2. Download service for Docker Hub
3. Run the service
4. Enjoy it
Kitematic
Reference
10個Q&A快速認識Docker
《Docker —— 從入門到實踐》正體中文版
CI/CD Reference Architecture with Docker
漫谈Docker--云时代的程序分发方式

Docker - fundamental

  • 1.
  • 2.
    What is docker whatcan docker do Docker hands on problems
  • 3.
  • 4.
    Build, Ship, Run Anopen platform for distributed applications for developers and sysadmins Docker uses resource isolation features of the Linux kernel. Docker allows you to package an application with all of its dependencies into a standardized unit for software development Lightweight Open Security
  • 5.
    How to workwith Linux Kernal
  • 6.
    Different from VM Containershave similar resource isolation and allocation benefits as virtual machines but a different architectural approach allows them to be much more portable and efficient.
  • 7.
    Dockerfile Docker can buildimages automatically by reading the instructions from a Dockerfile. A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image. Using docker build users can create an automated build that executes several command-line instructions in succession. Sample of Redis https://docs.docker.com/examples/running_redis_service/
  • 8.
    Docker Hub The DockerHub is a cloud-based registry service for building and shipping application or service containers. https://hub.docker.com/
  • 9.
  • 10.
    Docker with AWS DockerContainers on AWS
  • 11.
    Docker with Azure QuickStart: Windows Server Containers and Docker
  • 12.
  • 13.
  • 14.
    Benefits from Docker AccelerateDeveloper Onboarding Empower Developer Creativity Eliminate Environment Inconsistencies Easily Share and Collaborate on Applications Ship More Software Faster Quickly Scale Easily Remediate Issues
  • 15.
    Scenario : NewComer on Board(Now) Install VS Prepare development environment Install DB(MSSQL, Oracle) Install IIS feature Install Redis, MongoDB Install Jenkins Install Task runner(Grunt/Gulp) Install other(NodeJS, Nginx, Elastic Search, etc…) Start domain training
  • 16.
  • 17.
    Scaenario : NewComer on Board(Docker) Install VS Docker Install & Run Start domain training Faster and more Simple
  • 18.
    Scenario : ContinuousIntegration (Now) Commit code to DEV SVN Build DEV SVN Test in DEV SVN But Broken another function or some urgent issue interrupted development
  • 19.
  • 20.
    Scenario : ContinuousIntegration (Docker) Develop in Local Build in Local Test in Local Consistent the tools and environments
  • 21.
  • 22.
  • 23.
    Docker on Windows WindowsServer 2016 and System Center 2016 support Windows Server Container Boot2Docker(for Windows & Mac) Lightweight Linux distribution based on Tiny Core Linux made specifically to run Dockercontainers. RAM, weighs ~27MB Boots in ~5s
  • 24.
    Docker Toolbox Required Enable VirtualizationTechnology on Bios Install Git(Docker Toolbox including it) Download Docker Toolbox Docker terminal Kitematic(GUI tool) First launch Docker terminal or Kitematic have problem please remove default VM and create a new one 1. docker-machine rm default 2. docker-machine --native-ssh create -d virtualbox
  • 25.
    Play with DockerToolbox - Docker terminal 1. Create a Docker container from Dockerfile 2. Build Instance docker build -t <your username>/redis . 3. Run the service docker run --name redis -d <your username>/redis Docker terminal
  • 26.
    Play with DockerToolbox - Kitematic 1. Open Kitematic(Docker GUI tool) 2. Download service for Docker Hub 3. Run the service 4. Enjoy it Kitematic
  • 27.
    Reference 10個Q&A快速認識Docker 《Docker —— 從入門到實踐》正體中文版 CI/CDReference Architecture with Docker 漫谈Docker--云时代的程序分发方式

Editor's Notes

  • #6 上图中的cgroups、namespaces和apparmor等都是Linux内核提供的功能。不管是传统的LXC还是Docker的libcontainer,都使用了Kernel的这些功能来实现容器功能。