SlideShare a Scribd company logo
Docker Introduction 
By Walter Liu 2014/08/25
Agenda 
• What is Docker? 
• How to use Docker? 
• Miscellaneous 
– Pitfall during POC 
– Tips and tricks 
– Some references
What is Docker?
Docker introduction
Difference with VM 
Virtual Machines 
Docker
Difference with VM 
– Memory is acquired when needed. 
– Disk is acquired when needed. 
• (If use devicemapper has had 10 GB limitation) 
– Some file system is readonly. 
• Need to use priority mode to change it, but be careful 
about that. I destroyed the container during functional 
test.
File System Copy on write
What does Docker want to solve? 
The Matrix From Hell
Many Payloads …... 
• RHEL 4 
• CentOS 5 
• CentOS 6 
• CentOS 7 
• ……
Many Payloads …... 
• C/C++ 
• C/C++ libraries 
• Python2.3/2.4/2.6 
• Python Libs 
• Boostpython 
• Ruby 
• Php 
• Java 
• …..
Many Payloads …... 
• Nginx 
• Apache 
• Uwsgi 
• Django 
• Bottle 
• …..
Many Payloads …... 
+ our application
Many targets 
• Your dev environment 
• Co-worker dev environment 
• QA test environment 
• Staging environment 
• Production environment 
• Customized environment
How do we want to use it? 
• Same environment between RD and OPS. 
• Faster delivery 
• Run old Linux in new Linux environment. 
– OPS could upgrade system OS without worry if old 
application’s env. 
– If 2 applications are bound together, by using Docker 
their OS env could be upgraded at different time. 
• Upgrade host OS without changing application.
How others use it? 
• Easy Application Deployment 
• Continuous Integration 
• Continuous Delivery 
• Platform-as-a-Service (PaaS) 
• Development Environments & Build Pipelines - 
Spotify
Easy Application Deployment
Continuous Integration/Delivery 
• Write code 
• Push to git 
• Jenkins is triggered to build container and test 
the container. 
• If the test is successful, push to private docker 
registry. (Continuous Integration) 
• Automatic pull newest docker image to 
staging/production server and switch load 
balance from previous version. (Continuous 
Delivery)
Development Environments & Build 
Pipelines
Docker Requirement/Dependency 
• Linux Kernel 3.8+ 
– CentOS 6.5+ (CentOS 7 is recommended) 
– Ubuntu is officially recommended. 
• AUFS Support 
– (Not in CentOS, need Kernel patch) 
• Cgroups and namespaces (Kernel 2.6.38+) 
• lxc 
• xz-utils
HOW TO USE DOCKER?
Docker introduction
Installation 
• yum install docker-io #EPEL repo 
• service docker start 
• chkconfig docker on 
• Option: 
– Add a user to run docker as root.
Import Image 
• From docker repository 
– CMD: docker pull centos 
• From a tar ball 
– CMD: docker load centos-wcs-build-1000.tar 
• From private docker repository
Run container 
• docker run –it <image_id> /bin/bash 
• Run docker container as a service 
– Use supervisor is a good choice. 
– Check example https://github.com/Krijger/docker-cookbooks 
– And http://docs.docker.com/articles/using_supervisord/ 
• Note: if the process terminated, the container is terminated 
too.
Mount volume in a container 
• option: -v , could be used multiple times to 
mount multiple volume. 
• syntax: 
– docker run -v <host_path>:<container_path> ….. 
– docker run -v <host_path>:<container_path>:rw ….. 
– docker run -v <host_path>:<container_path>:ro ….. 
• Example: docker run –it –v 
/trend/wcs/ptn:/trend/wcs/ptn:ro <image_id> 
/bin/bash
Publish port 
• Option: “-p" Could be used multiple times to publish 
multiple ports to host. 
• syntax: 
– docker run –P …. # Publish all ports to host, it’s big P. 
– docker run –p <host_container_port> …. # random port 
– docker run –p <host_port>:<container_port> …. 
– docker run – 
p <host_interface_ip>:<host_port>:<container_port> …. 
• Example: docker run –P <image_id> "/trend/wcs/wcsd" 
"/trend/wcs/conf/wcs.config"
Dockerfile example 
This is not correct.
MISCELLANEOUS
Pitfall during POC 
• Use too old Linux kernel (CentOS 6.4) 
• Use priority mode 
– Crash the container, all commands printed core 
dump. 
• Run IO-heavy job on devicemapper. (4x slow) 
• Host and container uid is not sync. 
– WORKAROUND: adduser –u 1000 –g 1000 wcs
Tips and tricks 
• Kill all containers 
– docker kill $(docker ps -q) 
• Remove contents of all containers 
– docker rm $(docker ps -a –q) 
• Remove all images 
– docker rmi $(docker images -q -a) 
• Inspect IP of the container that just ran, 
– CID=$(docker run -d -p 4321 base nc -lk 4321) 
– docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${CID}
Some References 
• 使用DEVICE MAPPER 插件来改变DOCKER 容 
器的大小 
https://www.dockboard.org/resizing-docker-containers- 
with-the-device-mapper-plugin/ 
• WHY YOU DON'T NEED TO RUN SSHD IN YOUR 
DOCKER CONTAINERS? 
– http://blog.docker.com/2014/06/why-you-dont-need- 
to-run-sshd-in-docker/
Docker introduction
Backup slides
The problems 
• OPS needs to do 
– Installation, 
– Dependency 
– Monitor 
• Environment conflict 
• Environment diff between Dev and production
Docker introduction
Ad

More Related Content

What's hot (20)

Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux Kernel
Docker, Inc.
 
Docker
DockerDocker
Docker
Patrick Oberdorf
 
Docker orchestration using core os and ansible - Ansible IL 2015
Docker orchestration using core os and ansible - Ansible IL 2015Docker orchestration using core os and ansible - Ansible IL 2015
Docker orchestration using core os and ansible - Ansible IL 2015
Leonid Mirsky
 
docker installation and basics
docker installation and basicsdocker installation and basics
docker installation and basics
Walid Ashraf
 
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconfContinuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Julia Mateo
 
About docker in GDG Seoul
About docker in GDG SeoulAbout docker in GDG Seoul
About docker in GDG Seoul
Jude Kim
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014
D
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
dotCloud
 
Docker Continuous Delivery Workshop
Docker Continuous Delivery WorkshopDocker Continuous Delivery Workshop
Docker Continuous Delivery Workshop
Jirayut Nimsaeng
 
Docker & ci
Docker & ciDocker & ci
Docker & ci
Patxi Gortázar
 
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochraneDocker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken Cochrane
dotCloud
 
First steps to docker
First steps to dockerFirst steps to docker
First steps to docker
Guilhem Marty
 
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
ahunnargikar
 
Docker & JVM: A Perfect Match
Docker & JVM: A Perfect MatchDocker & JVM: A Perfect Match
Docker & JVM: A Perfect Match
Matthias Grüter
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Hiroki Endo
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ElasTest Project
 
Dockerfile basics | docker workshop #1 at Rackspace
Dockerfile basics | docker workshop #1 at RackspaceDockerfile basics | docker workshop #1 at Rackspace
Dockerfile basics | docker workshop #1 at Rackspace
dotCloud
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
Jaehwa Park
 
CoreOS : 설치부터 컨테이너 배포까지
CoreOS : 설치부터 컨테이너 배포까지CoreOS : 설치부터 컨테이너 배포까지
CoreOS : 설치부터 컨테이너 배포까지
충섭 김
 
Docker
DockerDocker
Docker
Vitaly Tsaplin
 
Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux Kernel
Docker, Inc.
 
Docker orchestration using core os and ansible - Ansible IL 2015
Docker orchestration using core os and ansible - Ansible IL 2015Docker orchestration using core os and ansible - Ansible IL 2015
Docker orchestration using core os and ansible - Ansible IL 2015
Leonid Mirsky
 
docker installation and basics
docker installation and basicsdocker installation and basics
docker installation and basics
Walid Ashraf
 
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconfContinuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Julia Mateo
 
About docker in GDG Seoul
About docker in GDG SeoulAbout docker in GDG Seoul
About docker in GDG Seoul
Jude Kim
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014
D
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
dotCloud
 
Docker Continuous Delivery Workshop
Docker Continuous Delivery WorkshopDocker Continuous Delivery Workshop
Docker Continuous Delivery Workshop
Jirayut Nimsaeng
 
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochraneDocker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken Cochrane
dotCloud
 
First steps to docker
First steps to dockerFirst steps to docker
First steps to docker
Guilhem Marty
 
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
ahunnargikar
 
Docker & JVM: A Perfect Match
Docker & JVM: A Perfect MatchDocker & JVM: A Perfect Match
Docker & JVM: A Perfect Match
Matthias Grüter
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Hiroki Endo
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ElasTest Project
 
Dockerfile basics | docker workshop #1 at Rackspace
Dockerfile basics | docker workshop #1 at RackspaceDockerfile basics | docker workshop #1 at Rackspace
Dockerfile basics | docker workshop #1 at Rackspace
dotCloud
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
Jaehwa Park
 
CoreOS : 설치부터 컨테이너 배포까지
CoreOS : 설치부터 컨테이너 배포까지CoreOS : 설치부터 컨테이너 배포까지
CoreOS : 설치부터 컨테이너 배포까지
충섭 김
 

Similar to Docker introduction (20)

Docking postgres
Docking postgresDocking postgres
Docking postgres
rycamor
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Kuan Yen Heng
 
Docker 2014
Docker 2014Docker 2014
Docker 2014
Open Networking Perú (Opennetsoft)
 
Django and Docker
Django and DockerDjango and Docker
Django and Docker
Docker, Inc.
 
Docker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsDocker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and tools
Ramit Surana
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
Geeta Vinnakota
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Docker
nklmish
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
Dongwon Kim
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" Edition
Jérôme Petazzoni
 
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniWorkshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
TheFamily
 
Postgre sql linuxcontainers by Jignesh Shah
Postgre sql linuxcontainers by Jignesh ShahPostgre sql linuxcontainers by Jignesh Shah
Postgre sql linuxcontainers by Jignesh Shah
PivotalOpenSourceHub
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons Learned
DataStax Academy
 
A Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and ContainersA Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and Containers
Docker, Inc.
 
Docker crash course
Docker crash courseDocker crash course
Docker crash course
nispas
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
Chris Tankersley
 
PostgreSQL and Linux Containers
PostgreSQL and Linux ContainersPostgreSQL and Linux Containers
PostgreSQL and Linux Containers
Jignesh Shah
 
Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1
Docker, Inc.
 
Docker presentation | Paris Docker Meetup
Docker presentation | Paris Docker MeetupDocker presentation | Paris Docker Meetup
Docker presentation | Paris Docker Meetup
dotCloud
 
Introduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkIntroduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New York
Jérôme Petazzoni
 
Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and Containers
Docker, Inc.
 
Docking postgres
Docking postgresDocking postgres
Docking postgres
rycamor
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Kuan Yen Heng
 
Docker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsDocker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and tools
Ramit Surana
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
Geeta Vinnakota
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Docker
nklmish
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
Dongwon Kim
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" Edition
Jérôme Petazzoni
 
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniWorkshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
TheFamily
 
Postgre sql linuxcontainers by Jignesh Shah
Postgre sql linuxcontainers by Jignesh ShahPostgre sql linuxcontainers by Jignesh Shah
Postgre sql linuxcontainers by Jignesh Shah
PivotalOpenSourceHub
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons Learned
DataStax Academy
 
A Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and ContainersA Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and Containers
Docker, Inc.
 
Docker crash course
Docker crash courseDocker crash course
Docker crash course
nispas
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
Chris Tankersley
 
PostgreSQL and Linux Containers
PostgreSQL and Linux ContainersPostgreSQL and Linux Containers
PostgreSQL and Linux Containers
Jignesh Shah
 
Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1Victor Vieux at Docker Paris Meetup #1
Victor Vieux at Docker Paris Meetup #1
Docker, Inc.
 
Docker presentation | Paris Docker Meetup
Docker presentation | Paris Docker MeetupDocker presentation | Paris Docker Meetup
Docker presentation | Paris Docker Meetup
dotCloud
 
Introduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkIntroduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New York
Jérôme Petazzoni
 
Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and Containers
Docker, Inc.
 
Ad

More from Walter Liu (18)

Generative AI 在手機遊戲發行上的應用介紹.pdf
Generative AI 在手機遊戲發行上的應用介紹.pdfGenerative AI 在手機遊戲發行上的應用介紹.pdf
Generative AI 在手機遊戲發行上的應用介紹.pdf
Walter Liu
 
Infrastructure as code using Kubernetes
Infrastructure as code using KubernetesInfrastructure as code using Kubernetes
Infrastructure as code using Kubernetes
Walter Liu
 
手機遊戲數位行銷工具淺談
手機遊戲數位行銷工具淺談手機遊戲數位行銷工具淺談
手機遊戲數位行銷工具淺談
Walter Liu
 
關於第三方追蹤廣告再行銷的那些事兒
關於第三方追蹤廣告再行銷的那些事兒關於第三方追蹤廣告再行銷的那些事兒
關於第三方追蹤廣告再行銷的那些事兒
Walter Liu
 
Kubernetes Workshop
Kubernetes WorkshopKubernetes Workshop
Kubernetes Workshop
Walter Liu
 
Using Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCPUsing Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCP
Walter Liu
 
Game DDOS Prevention
Game DDOS PreventionGame DDOS Prevention
Game DDOS Prevention
Walter Liu
 
Airflow - a data flow engine
Airflow - a data flow engineAirflow - a data flow engine
Airflow - a data flow engine
Walter Liu
 
Super Fast Gevent Introduction
Super Fast Gevent IntroductionSuper Fast Gevent Introduction
Super Fast Gevent Introduction
Walter Liu
 
HTTP/2 to web dev
HTTP/2 to web devHTTP/2 to web dev
HTTP/2 to web dev
Walter Liu
 
HTTP/2 Introduction
HTTP/2 IntroductionHTTP/2 Introduction
HTTP/2 Introduction
Walter Liu
 
Consul - service discovery and others
Consul - service discovery and othersConsul - service discovery and others
Consul - service discovery and others
Walter Liu
 
WRS GIT Branching Model - draft
WRS GIT Branching Model - draftWRS GIT Branching Model - draft
WRS GIT Branching Model - draft
Walter Liu
 
Salty OPS – Saltstack Introduction
Salty OPS – Saltstack IntroductionSalty OPS – Saltstack Introduction
Salty OPS – Saltstack Introduction
Walter Liu
 
Django deployment and rpm+yum
Django deployment and rpm+yumDjango deployment and rpm+yum
Django deployment and rpm+yum
Walter Liu
 
Game Localization in Python
Game Localization in PythonGame Localization in Python
Game Localization in Python
Walter Liu
 
Service production from d3 pitfall viewpoint
Service production from d3 pitfall viewpointService production from d3 pitfall viewpoint
Service production from d3 pitfall viewpoint
Walter Liu
 
Celery in the Django
Celery in the DjangoCelery in the Django
Celery in the Django
Walter Liu
 
Generative AI 在手機遊戲發行上的應用介紹.pdf
Generative AI 在手機遊戲發行上的應用介紹.pdfGenerative AI 在手機遊戲發行上的應用介紹.pdf
Generative AI 在手機遊戲發行上的應用介紹.pdf
Walter Liu
 
Infrastructure as code using Kubernetes
Infrastructure as code using KubernetesInfrastructure as code using Kubernetes
Infrastructure as code using Kubernetes
Walter Liu
 
手機遊戲數位行銷工具淺談
手機遊戲數位行銷工具淺談手機遊戲數位行銷工具淺談
手機遊戲數位行銷工具淺談
Walter Liu
 
關於第三方追蹤廣告再行銷的那些事兒
關於第三方追蹤廣告再行銷的那些事兒關於第三方追蹤廣告再行銷的那些事兒
關於第三方追蹤廣告再行銷的那些事兒
Walter Liu
 
Kubernetes Workshop
Kubernetes WorkshopKubernetes Workshop
Kubernetes Workshop
Walter Liu
 
Using Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCPUsing Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCP
Walter Liu
 
Game DDOS Prevention
Game DDOS PreventionGame DDOS Prevention
Game DDOS Prevention
Walter Liu
 
Airflow - a data flow engine
Airflow - a data flow engineAirflow - a data flow engine
Airflow - a data flow engine
Walter Liu
 
Super Fast Gevent Introduction
Super Fast Gevent IntroductionSuper Fast Gevent Introduction
Super Fast Gevent Introduction
Walter Liu
 
HTTP/2 to web dev
HTTP/2 to web devHTTP/2 to web dev
HTTP/2 to web dev
Walter Liu
 
HTTP/2 Introduction
HTTP/2 IntroductionHTTP/2 Introduction
HTTP/2 Introduction
Walter Liu
 
Consul - service discovery and others
Consul - service discovery and othersConsul - service discovery and others
Consul - service discovery and others
Walter Liu
 
WRS GIT Branching Model - draft
WRS GIT Branching Model - draftWRS GIT Branching Model - draft
WRS GIT Branching Model - draft
Walter Liu
 
Salty OPS – Saltstack Introduction
Salty OPS – Saltstack IntroductionSalty OPS – Saltstack Introduction
Salty OPS – Saltstack Introduction
Walter Liu
 
Django deployment and rpm+yum
Django deployment and rpm+yumDjango deployment and rpm+yum
Django deployment and rpm+yum
Walter Liu
 
Game Localization in Python
Game Localization in PythonGame Localization in Python
Game Localization in Python
Walter Liu
 
Service production from d3 pitfall viewpoint
Service production from d3 pitfall viewpointService production from d3 pitfall viewpoint
Service production from d3 pitfall viewpoint
Walter Liu
 
Celery in the Django
Celery in the DjangoCelery in the Django
Celery in the Django
Walter Liu
 
Ad

Recently uploaded (20)

TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 

Docker introduction

  • 1. Docker Introduction By Walter Liu 2014/08/25
  • 2. Agenda • What is Docker? • How to use Docker? • Miscellaneous – Pitfall during POC – Tips and tricks – Some references
  • 5. Difference with VM Virtual Machines Docker
  • 6. Difference with VM – Memory is acquired when needed. – Disk is acquired when needed. • (If use devicemapper has had 10 GB limitation) – Some file system is readonly. • Need to use priority mode to change it, but be careful about that. I destroyed the container during functional test.
  • 7. File System Copy on write
  • 8. What does Docker want to solve? The Matrix From Hell
  • 9. Many Payloads …... • RHEL 4 • CentOS 5 • CentOS 6 • CentOS 7 • ……
  • 10. Many Payloads …... • C/C++ • C/C++ libraries • Python2.3/2.4/2.6 • Python Libs • Boostpython • Ruby • Php • Java • …..
  • 11. Many Payloads …... • Nginx • Apache • Uwsgi • Django • Bottle • …..
  • 12. Many Payloads …... + our application
  • 13. Many targets • Your dev environment • Co-worker dev environment • QA test environment • Staging environment • Production environment • Customized environment
  • 14. How do we want to use it? • Same environment between RD and OPS. • Faster delivery • Run old Linux in new Linux environment. – OPS could upgrade system OS without worry if old application’s env. – If 2 applications are bound together, by using Docker their OS env could be upgraded at different time. • Upgrade host OS without changing application.
  • 15. How others use it? • Easy Application Deployment • Continuous Integration • Continuous Delivery • Platform-as-a-Service (PaaS) • Development Environments & Build Pipelines - Spotify
  • 17. Continuous Integration/Delivery • Write code • Push to git • Jenkins is triggered to build container and test the container. • If the test is successful, push to private docker registry. (Continuous Integration) • Automatic pull newest docker image to staging/production server and switch load balance from previous version. (Continuous Delivery)
  • 18. Development Environments & Build Pipelines
  • 19. Docker Requirement/Dependency • Linux Kernel 3.8+ – CentOS 6.5+ (CentOS 7 is recommended) – Ubuntu is officially recommended. • AUFS Support – (Not in CentOS, need Kernel patch) • Cgroups and namespaces (Kernel 2.6.38+) • lxc • xz-utils
  • 20. HOW TO USE DOCKER?
  • 22. Installation • yum install docker-io #EPEL repo • service docker start • chkconfig docker on • Option: – Add a user to run docker as root.
  • 23. Import Image • From docker repository – CMD: docker pull centos • From a tar ball – CMD: docker load centos-wcs-build-1000.tar • From private docker repository
  • 24. Run container • docker run –it <image_id> /bin/bash • Run docker container as a service – Use supervisor is a good choice. – Check example https://github.com/Krijger/docker-cookbooks – And http://docs.docker.com/articles/using_supervisord/ • Note: if the process terminated, the container is terminated too.
  • 25. Mount volume in a container • option: -v , could be used multiple times to mount multiple volume. • syntax: – docker run -v <host_path>:<container_path> ….. – docker run -v <host_path>:<container_path>:rw ….. – docker run -v <host_path>:<container_path>:ro ….. • Example: docker run –it –v /trend/wcs/ptn:/trend/wcs/ptn:ro <image_id> /bin/bash
  • 26. Publish port • Option: “-p" Could be used multiple times to publish multiple ports to host. • syntax: – docker run –P …. # Publish all ports to host, it’s big P. – docker run –p <host_container_port> …. # random port – docker run –p <host_port>:<container_port> …. – docker run – p <host_interface_ip>:<host_port>:<container_port> …. • Example: docker run –P <image_id> "/trend/wcs/wcsd" "/trend/wcs/conf/wcs.config"
  • 27. Dockerfile example This is not correct.
  • 29. Pitfall during POC • Use too old Linux kernel (CentOS 6.4) • Use priority mode – Crash the container, all commands printed core dump. • Run IO-heavy job on devicemapper. (4x slow) • Host and container uid is not sync. – WORKAROUND: adduser –u 1000 –g 1000 wcs
  • 30. Tips and tricks • Kill all containers – docker kill $(docker ps -q) • Remove contents of all containers – docker rm $(docker ps -a –q) • Remove all images – docker rmi $(docker images -q -a) • Inspect IP of the container that just ran, – CID=$(docker run -d -p 4321 base nc -lk 4321) – docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${CID}
  • 31. Some References • 使用DEVICE MAPPER 插件来改变DOCKER 容 器的大小 https://www.dockboard.org/resizing-docker-containers- with-the-device-mapper-plugin/ • WHY YOU DON'T NEED TO RUN SSHD IN YOUR DOCKER CONTAINERS? – http://blog.docker.com/2014/06/why-you-dont-need- to-run-sshd-in-docker/
  • 34. The problems • OPS needs to do – Installation, – Dependency – Monitor • Environment conflict • Environment diff between Dev and production

Editor's Notes

  • #10: Idea from a slide in slideshare.