Upload
chen-tien-tsai
View
317
Download
0
Embed Size (px)
Citation preview
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 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 thetools and environments
DOCKER HANDS ON
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--云时代的程序分发方式