SlideShare une entreprise Scribd logo
1  sur  66
Docker Workshop
Evans Ye
2014.10.13
Agenda
• Docker and underlying technologies
• Running Docker containers
• Building Docker images
• The official Docker hub
Containers offer faster automation
Docker Container
• A container is a group of isolated processes
– cgroups
– namespace
• Isolated processes run straight on the host
– native CPU performance
– minimal memory overhead
– minimal network performance overhead
7
CGroups
Cgroups (control groups)
• Linux kernel feature
• Groups of processes
• Resource limitations
– Like limits.conf
but the scope is a set of processes instead of uid/gid
• May be nested
Cgroups submodules
• memory
• CPU
• network IO
• disk IO
10
Namespaces
namespaces
• Linux kernel feature
• wrap particular global system resource in an
abstracted, isolated instance
• May be nested
Different kinds of namespaces
#TrendInsight
Running Docker Containers
Run Docker container in boot2docker directly
Create a container with interactive shell
$ docker run -t -i base:centos62 /bin/bash
[root@4d8c4b81f6d7 /]# exit (exited)
$ -t, --tty
Allocate a pseudo-TTY
$ -i, --interactive
Keep STDIN open even if not attached
Check containers’ status
$ docker ps
(only running containers are shown)
$ docker ps –a
(all)
Reattach in stopped container
$ docker start -i 4d8c4b81f6d7
[root@4d8c4b81f6d7 /]#
or use docker exec instead
$ docker start 4d8c4b81f6d7
$ docker exec –ti 4d8c4b81f6d7 bash
[root@4d8c4b81f6d7 /]#
Take a look at Docker run command
$ docker run -t -i base:centos62 /bin/bash
Command + args
$ docker run base:centos62 /bin/cat /etc/hosts
Name a container
$ docker run -ti --name foo base:centos62 /bin/bash
$ docker ps -a
$ docker rm foo
destroy foo container
Destroy all containers
$ docker rm `docker ps --no-trunc -aq`
(except running containers, they must be stopped first)
$ docker rm -f `docker ps --no-trunc -aq`
(force destroy all containers)
Create ephemeral container
$ docker run -ti --rm base:centos62 /bin/bash
[root@4d8c4b81f6d7 /]# exit (destroyed upon exit)
$ docker ps -a
Ports forwarding (publish)
$ docker run -ti -p 80:80 base:centos62 /bin/bash
# yum install httpd
# echo "hello world" > /var/www/html/index.html
# service httpd start
$ curl localhost:80
What does Docker port forwarding do?
Windows / OS X
boot2docker
Container Container 80
80
27
Well, I need to
render it
in browsers…
How about this?
Windows / OS X
boot2docker
Container Container 80
80
80
Doable via Vagrant
$ vim Vagrantfile
The solution
Windows / OS X
boot2docker
Container Container 80
80
80
 Docker
port
forwarding Vagrant
port forwarding
More about Docker ports forwarding
$ docker run -ti -p 80:80 base:centos62 /bin/bash
• -p, --publish
Publish a container's port to the host
• format:
– ip:hostPort:containerPort (10.1.1.1:80:80)
– ip::containerPort (10.1.1.1::80)
– hostPort:containerPort (80:80)
Volume (like sync folder)
$ docker run -ti --name apache
-v /httpd-logs:/var/log/httpd base:centos62
/bin/bash
# touch /var/log/httpd/foo
$ ls /http-logs
Volume from other container
(useful to share data)
$ docker run -ti --volumes-from apache
base:centos62 /bin/bash
# ls /var/log/httpd
Link
$ docker run -ti --link apache:apache.trendmicro.com
base:centos62 /bin/bash
# cat /etc/hosts
• Exposes information from source container to recipient
container in two ways:
– Environment variables
– Updating the /etc/hosts file
• format:
– name:alias
useful in multi-node situation
12/25/2014
service
(hadoop-client)
data
(hadoop-client)
link
Docker in client/server mode
Windows / OS X
boot2docker
(Docker client)
Linux server
Docker Engine
Container Container
Server: bind Docker engine to a tcp port
$ docker -d -H 10.1.1.1:2375 -H
unix:///var/run/docker.sock
• -d, --daemon
daemon mode
• -H, --host
the socket(s) to bind in daemon mode
Docker client
$ export DOCKER_HOST=tcp://10.1.1.1:2375
$ docker images
$ docker run -ti --rm centos:centos6 /bin/bash
(start container on the server)
• Note:
– expose tcp port could let someone get root access to the host
– not recommended in open network
Running containers in background
(Detached mode)
$ hadoop=$(docker run -d -p 50070:50070
tmh6:centos62)
$ docker inspect $hadoop
40
Vagrant creates
Docker containers in
detached mode
Some other VM-like operations
$ docker stop $hadoop
$ docker start $hadoop
$ docker kill $hadoop
$ docker rm $hadoop
https://docs.docker.com/reference/commandline/cli/
#TrendInsight
Building Docker Images
43
There are two ways
to build docker
images
First: commit an existing container
• Do changes manually, then commit
 quick and dirty
 suitable for experiment
 might be deleted in the future
Second: Build from Dockerfile
• Dockerfile is a series of instructions
• Use "Docker build" command to build images
• pros:
– build images automatically by following instructions
– visible and easy to understand instructions
– enable Docker specific functions in the image
– repeatability
A sample httpd service Dockerfile
FROM base:centos62
COPY index.html /var/www/html/index.html
RUN yum -y install httpd
EXPOSE 80
CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]
Build
$ mkdir apache-server
$ cd apache-server
$ echo "our first docker image" > index.html
$ vi Dockerfile (paste the sample and save it)
$ docker build -t apache:0.1 ./
Build context
• docker build -t apache:0.1 ./
• ./ will be transferred to Docker daemon as build
context
• Must have a Dockerfile there
– ./Dockerfile
• DO NOT build at /
– docker build -t apache:0.1 /
Run the apache image
$ docker run -d --name apache apache:0.1
$ docker run -ti --rm --link apache:a01
base:centos62 /bin/bash
# curl $A01_PORT_80_TCP_ADDR
(you see how link and expose work together)
50
Use entrypoint to
bind a specific
executable to the
image
An httpd service example
FROM base:centos62
COPY index.html /var/www/html/index.html
RUN yum -y install httpd
EXPOSE 80
ENTRYPOINT ["/usr/sbin/httpd"]
CMD ["-D", "FOREGROUND"]
The difference
$ docker run -ti --rm apache:0.1 /bin/bash
# (get into the container)
$ docker run -ti --rm apache:0.2 /bin/bash
show httpd helper message
 the only thing you can do is to pass args to httpd
Make sure init script always being executed
FROM base:centos62
…
ENTRYPOINT ["init_wrapper_script"]
CMD ["default_args"]
https://docs.docker.com/articles/dockerfile_best-practices/
SHIPPING
CONTAINERS
Tagging an image
$ docker tag -h
• dockerhub.evansye.com/base:centos62
– REGISTRYHOST = dockerhub.evansye.com
– NAME = base
– TAG = centos62
#TrendInsight
The official Docker hub
Redis
$ docker run -d --name some-redis redis
$ docker run -ti --rm --link some-redis:redis redis
/bin/bash
# redis-cli
-h $REDIS_PORT_6379_TCP_ADDR
-p $REDIS_PORT_6379_TCP_PORT
https://registry.hub.docker.com/_/redis/
MySQL
$ docker run -d --name some-mysql -e
MYSQL_ROOT_PASSWORD=demo mysql
$ docker run -it --link some-mysql:mysql --rm mysql sh -c 'exec
mysql
-h"$MYSQL_PORT_3306_TCP_ADDR"
-P"$MYSQL_PORT_3306_TCP_PORT"
-uroot
-p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"'
https://registry.hub.docker.com/_/mysql/
Jenkins
$ docker run -d -p 8080:8080 Jenkins
http://HOST_IP:8080
https://registry.hub.docker.com/_/jenkins/
Private Docker registry
$ docker run -d -p 5000:5000 registry
$ docker tag IMAGE HOST_IP:5000/NAME:TAG
$ docker push HOST_IP:5000/NAME:TAG
https://registry.hub.docker.com/_/registry/
#TrendInsight
Summary
Recap docker run
• we’ve learned:
– port forwarding
– volume mounting
– linking containers together
– running containers at remote
Recap docker build
• we’ve learned:
– how to write a Dockerfile
– how expose and link work together
– use entrypoint to bind a specific executable with image
– ship images to the registry
#TrendInsight
Q & A
Re-associate Vagrant with VM
• VBoxManage list vms
• cd .vagrant/machines/docker-
platform/virtualbox/
• touch id
• echo 33ca… > id

Contenu connexe

Tendances

Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewiredotCloud
 
Docker puebla bday #4 celebration
Docker puebla bday #4 celebrationDocker puebla bday #4 celebration
Docker puebla bday #4 celebrationRamon Morales
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerWei-Ting Kuo
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutesLarry Cai
 
Docker Introductory workshop
Docker Introductory workshopDocker Introductory workshop
Docker Introductory workshopRuncy Oommen
 
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 RackspacedotCloud
 
Docker Continuous Delivery Workshop
Docker Continuous Delivery WorkshopDocker Continuous Delivery Workshop
Docker Continuous Delivery WorkshopJirayut Nimsaeng
 
Locally it worked! virtualizing docker
Locally it worked! virtualizing dockerLocally it worked! virtualizing docker
Locally it worked! virtualizing dockerSascha Brinkmann
 
docker installation and basics
docker installation and basicsdocker installation and basics
docker installation and basicsWalid Ashraf
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and AgentRanjit Avasarala
 
Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Alessandro Mignogna
 
Using Docker in the Real World
Using Docker in the Real WorldUsing Docker in the Real World
Using Docker in the Real WorldTim Haak
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesLuciano Fiandesio
 
Docker and Puppet — Puppet Camp L.A. — SCALE12X
Docker and Puppet — Puppet Camp L.A. — SCALE12XDocker and Puppet — Puppet Camp L.A. — SCALE12X
Docker and Puppet — Puppet Camp L.A. — SCALE12XJérôme Petazzoni
 
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12dotCloud
 

Tendances (19)

Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
 
Docker puebla bday #4 celebration
Docker puebla bday #4 celebrationDocker puebla bday #4 celebration
Docker puebla bday #4 celebration
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutes
 
Vagrant
VagrantVagrant
Vagrant
 
Dockerfile
Dockerfile Dockerfile
Dockerfile
 
Docker Introductory workshop
Docker Introductory workshopDocker Introductory workshop
Docker Introductory workshop
 
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
 
Docker Continuous Delivery Workshop
Docker Continuous Delivery WorkshopDocker Continuous Delivery Workshop
Docker Continuous Delivery Workshop
 
Locally it worked! virtualizing docker
Locally it worked! virtualizing dockerLocally it worked! virtualizing docker
Locally it worked! virtualizing docker
 
docker installation and basics
docker installation and basicsdocker installation and basics
docker installation and basics
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and Agent
 
Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021
 
Vagrant + Docker
Vagrant + DockerVagrant + Docker
Vagrant + Docker
 
Using Docker in the Real World
Using Docker in the Real WorldUsing Docker in the Real World
Using Docker in the Real World
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
 
Docker orchestration
Docker orchestrationDocker orchestration
Docker orchestration
 
Docker and Puppet — Puppet Camp L.A. — SCALE12X
Docker and Puppet — Puppet Camp L.A. — SCALE12XDocker and Puppet — Puppet Camp L.A. — SCALE12X
Docker and Puppet — Puppet Camp L.A. — SCALE12X
 
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
 

En vedette

Docker Overview - AWS Tech Connect - Seattle 10/28
Docker Overview - AWS Tech Connect - Seattle 10/28Docker Overview - AWS Tech Connect - Seattle 10/28
Docker Overview - AWS Tech Connect - Seattle 10/28Mike Coleman
 
Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Pini Reznik
 
Docker & aPaaS: Enterprise Innovation and Trends for 2015
Docker & aPaaS: Enterprise Innovation and Trends for 2015Docker & aPaaS: Enterprise Innovation and Trends for 2015
Docker & aPaaS: Enterprise Innovation and Trends for 2015WaveMaker, Inc.
 
Docker networking Tutorial 101
Docker networking Tutorial 101Docker networking Tutorial 101
Docker networking Tutorial 101LorisPack Project
 
Docker Workshop for beginner
Docker Workshop for beginnerDocker Workshop for beginner
Docker Workshop for beginnerJirayut Nimsaeng
 
Docker Workshop Birthday #3
Docker Workshop Birthday #3Docker Workshop Birthday #3
Docker Workshop Birthday #3Jirayut Nimsaeng
 
A New Centralized Volume Storage Solution for Docker and Container Cloud by W...
A New Centralized Volume Storage Solution for Docker and Container Cloud by W...A New Centralized Volume Storage Solution for Docker and Container Cloud by W...
A New Centralized Volume Storage Solution for Docker and Container Cloud by W...Docker, Inc.
 

En vedette (9)

Docker Overview - AWS Tech Connect - Seattle 10/28
Docker Overview - AWS Tech Connect - Seattle 10/28Docker Overview - AWS Tech Connect - Seattle 10/28
Docker Overview - AWS Tech Connect - Seattle 10/28
 
Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014
 
Docker & aPaaS: Enterprise Innovation and Trends for 2015
Docker & aPaaS: Enterprise Innovation and Trends for 2015Docker & aPaaS: Enterprise Innovation and Trends for 2015
Docker & aPaaS: Enterprise Innovation and Trends for 2015
 
Docker From Scratch
Docker From ScratchDocker From Scratch
Docker From Scratch
 
Docker networking Tutorial 101
Docker networking Tutorial 101Docker networking Tutorial 101
Docker networking Tutorial 101
 
Docker in Production
Docker in ProductionDocker in Production
Docker in Production
 
Docker Workshop for beginner
Docker Workshop for beginnerDocker Workshop for beginner
Docker Workshop for beginner
 
Docker Workshop Birthday #3
Docker Workshop Birthday #3Docker Workshop Birthday #3
Docker Workshop Birthday #3
 
A New Centralized Volume Storage Solution for Docker and Container Cloud by W...
A New Centralized Volume Storage Solution for Docker and Container Cloud by W...A New Centralized Volume Storage Solution for Docker and Container Cloud by W...
A New Centralized Volume Storage Solution for Docker and Container Cloud by W...
 

Similaire à Docker workshop

Introduction to Docker - Learning containerization XP conference 2016
Introduction to Docker - Learning containerization  XP conference 2016Introduction to Docker - Learning containerization  XP conference 2016
Introduction to Docker - Learning containerization XP conference 2016XP Conference India
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 applicationRoman Rodomansky
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerRunning the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerGuido Schmutz
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Ben Hall
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortalsHenryk Konsek
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionBen Hall
 
Docker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google CloudDocker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google CloudSamuel Chow
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017Paul Chao
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachPROIDEA
 
Docker 基本概念與指令操作
Docker  基本概念與指令操作Docker  基本概念與指令操作
Docker 基本概念與指令操作NUTC, imac
 
Docker presentation | Paris Docker Meetup
Docker presentation | Paris Docker MeetupDocker presentation | Paris Docker Meetup
Docker presentation | Paris Docker MeetupdotCloud
 
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 #1Docker, Inc.
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇Philip Zheng
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on DockerBen Hall
 
Introction to docker swarm
Introction to docker swarmIntroction to docker swarm
Introction to docker swarmHsi-Kai Wang
 
Tribal Nova Docker workshop
Tribal Nova Docker workshopTribal Nova Docker workshop
Tribal Nova Docker workshopNicolas Degardin
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Paul Chao
 

Similaire à Docker workshop (20)

Introduction to Docker - Learning containerization XP conference 2016
Introduction to Docker - Learning containerization  XP conference 2016Introduction to Docker - Learning containerization  XP conference 2016
Introduction to Docker - Learning containerization XP conference 2016
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerRunning the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker Container
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
Docker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google CloudDocker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google Cloud
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
 
Docker 基本概念與指令操作
Docker  基本概念與指令操作Docker  基本概念與指令操作
Docker 基本概念與指令操作
 
Docker presentation | Paris Docker Meetup
Docker presentation | Paris Docker MeetupDocker presentation | Paris Docker Meetup
Docker presentation | Paris Docker Meetup
 
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
DockerDocker
Docker
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on Docker
 
Introction to docker swarm
Introction to docker swarmIntroction to docker swarm
Introction to docker swarm
 
Tribal Nova Docker workshop
Tribal Nova Docker workshopTribal Nova Docker workshop
Tribal Nova Docker workshop
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung
 

Plus de Evans Ye

Join ASF to Unlock Full Possibilities of Your Professional Career.pdf
Join ASF to Unlock Full Possibilities of Your Professional Career.pdfJoin ASF to Unlock Full Possibilities of Your Professional Career.pdf
Join ASF to Unlock Full Possibilities of Your Professional Career.pdfEvans Ye
 
非常人走非常路:參與ASF打世界杯比賽
非常人走非常路:參與ASF打世界杯比賽非常人走非常路:參與ASF打世界杯比賽
非常人走非常路:參與ASF打世界杯比賽Evans Ye
 
TensorFlow on Spark: A Deep Dive into Distributed Deep Learning
TensorFlow on Spark: A Deep Dive into Distributed Deep LearningTensorFlow on Spark: A Deep Dive into Distributed Deep Learning
TensorFlow on Spark: A Deep Dive into Distributed Deep LearningEvans Ye
 
2017 big data landscape and cutting edge innovations public
2017 big data landscape and cutting edge innovations public2017 big data landscape and cutting edge innovations public
2017 big data landscape and cutting edge innovations publicEvans Ye
 
ONE FOR ALL! Using Apache Calcite to make SQL smart
ONE FOR ALL! Using Apache Calcite to make SQL smartONE FOR ALL! Using Apache Calcite to make SQL smart
ONE FOR ALL! Using Apache Calcite to make SQL smartEvans Ye
 
The Apache Way: A Proven Way Toward Success
The Apache Way: A Proven Way Toward SuccessThe Apache Way: A Proven Way Toward Success
The Apache Way: A Proven Way Toward SuccessEvans Ye
 
The Apache Way
The Apache WayThe Apache Way
The Apache WayEvans Ye
 
Leveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioningLeveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioningEvans Ye
 
Using the SDACK Architecture to Build a Big Data Product
Using the SDACK Architecture to Build a Big Data ProductUsing the SDACK Architecture to Build a Big Data Product
Using the SDACK Architecture to Build a Big Data ProductEvans Ye
 
Trend Micro Big Data Platform and Apache Bigtop
Trend Micro Big Data Platform and Apache BigtopTrend Micro Big Data Platform and Apache Bigtop
Trend Micro Big Data Platform and Apache BigtopEvans Ye
 
How bigtop leveraged docker for build automation and one click hadoop provis...
How bigtop leveraged docker for build automation and  one click hadoop provis...How bigtop leveraged docker for build automation and  one click hadoop provis...
How bigtop leveraged docker for build automation and one click hadoop provis...Evans Ye
 
How bigtop leveraged docker for build automation and one click hadoop provis...
How bigtop leveraged docker for build automation and  one click hadoop provis...How bigtop leveraged docker for build automation and  one click hadoop provis...
How bigtop leveraged docker for build automation and one click hadoop provis...Evans Ye
 
BigTop vm and docker provisioner
BigTop vm and docker provisionerBigTop vm and docker provisioner
BigTop vm and docker provisionerEvans Ye
 
Fits docker into devops
Fits docker into devopsFits docker into devops
Fits docker into devopsEvans Ye
 
Getting involved in world class software engineering tips and tricks to join ...
Getting involved in world class software engineering tips and tricks to join ...Getting involved in world class software engineering tips and tricks to join ...
Getting involved in world class software engineering tips and tricks to join ...Evans Ye
 
Deep dive into enterprise data lake through Impala
Deep dive into enterprise data lake through ImpalaDeep dive into enterprise data lake through Impala
Deep dive into enterprise data lake through ImpalaEvans Ye
 
How we lose etu hadoop competition
How we lose etu hadoop competitionHow we lose etu hadoop competition
How we lose etu hadoop competitionEvans Ye
 
Network Traffic Search using Apache HBase
Network Traffic Search using Apache HBaseNetwork Traffic Search using Apache HBase
Network Traffic Search using Apache HBaseEvans Ye
 
Building hadoop based big data environment
Building hadoop based big data environmentBuilding hadoop based big data environment
Building hadoop based big data environmentEvans Ye
 

Plus de Evans Ye (20)

Join ASF to Unlock Full Possibilities of Your Professional Career.pdf
Join ASF to Unlock Full Possibilities of Your Professional Career.pdfJoin ASF to Unlock Full Possibilities of Your Professional Career.pdf
Join ASF to Unlock Full Possibilities of Your Professional Career.pdf
 
非常人走非常路:參與ASF打世界杯比賽
非常人走非常路:參與ASF打世界杯比賽非常人走非常路:參與ASF打世界杯比賽
非常人走非常路:參與ASF打世界杯比賽
 
TensorFlow on Spark: A Deep Dive into Distributed Deep Learning
TensorFlow on Spark: A Deep Dive into Distributed Deep LearningTensorFlow on Spark: A Deep Dive into Distributed Deep Learning
TensorFlow on Spark: A Deep Dive into Distributed Deep Learning
 
2017 big data landscape and cutting edge innovations public
2017 big data landscape and cutting edge innovations public2017 big data landscape and cutting edge innovations public
2017 big data landscape and cutting edge innovations public
 
ONE FOR ALL! Using Apache Calcite to make SQL smart
ONE FOR ALL! Using Apache Calcite to make SQL smartONE FOR ALL! Using Apache Calcite to make SQL smart
ONE FOR ALL! Using Apache Calcite to make SQL smart
 
The Apache Way: A Proven Way Toward Success
The Apache Way: A Proven Way Toward SuccessThe Apache Way: A Proven Way Toward Success
The Apache Way: A Proven Way Toward Success
 
The Apache Way
The Apache WayThe Apache Way
The Apache Way
 
Leveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioningLeveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioning
 
Using the SDACK Architecture to Build a Big Data Product
Using the SDACK Architecture to Build a Big Data ProductUsing the SDACK Architecture to Build a Big Data Product
Using the SDACK Architecture to Build a Big Data Product
 
Trend Micro Big Data Platform and Apache Bigtop
Trend Micro Big Data Platform and Apache BigtopTrend Micro Big Data Platform and Apache Bigtop
Trend Micro Big Data Platform and Apache Bigtop
 
How bigtop leveraged docker for build automation and one click hadoop provis...
How bigtop leveraged docker for build automation and  one click hadoop provis...How bigtop leveraged docker for build automation and  one click hadoop provis...
How bigtop leveraged docker for build automation and one click hadoop provis...
 
How bigtop leveraged docker for build automation and one click hadoop provis...
How bigtop leveraged docker for build automation and  one click hadoop provis...How bigtop leveraged docker for build automation and  one click hadoop provis...
How bigtop leveraged docker for build automation and one click hadoop provis...
 
BigTop vm and docker provisioner
BigTop vm and docker provisionerBigTop vm and docker provisioner
BigTop vm and docker provisioner
 
Fits docker into devops
Fits docker into devopsFits docker into devops
Fits docker into devops
 
Getting involved in world class software engineering tips and tricks to join ...
Getting involved in world class software engineering tips and tricks to join ...Getting involved in world class software engineering tips and tricks to join ...
Getting involved in world class software engineering tips and tricks to join ...
 
Deep dive into enterprise data lake through Impala
Deep dive into enterprise data lake through ImpalaDeep dive into enterprise data lake through Impala
Deep dive into enterprise data lake through Impala
 
How we lose etu hadoop competition
How we lose etu hadoop competitionHow we lose etu hadoop competition
How we lose etu hadoop competition
 
Network Traffic Search using Apache HBase
Network Traffic Search using Apache HBaseNetwork Traffic Search using Apache HBase
Network Traffic Search using Apache HBase
 
Vagrant
VagrantVagrant
Vagrant
 
Building hadoop based big data environment
Building hadoop based big data environmentBuilding hadoop based big data environment
Building hadoop based big data environment
 

Dernier

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 

Dernier (20)

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

Docker workshop

  • 2. Agenda • Docker and underlying technologies • Running Docker containers • Building Docker images • The official Docker hub
  • 3.
  • 4.
  • 6. Docker Container • A container is a group of isolated processes – cgroups – namespace • Isolated processes run straight on the host – native CPU performance – minimal memory overhead – minimal network performance overhead
  • 8. Cgroups (control groups) • Linux kernel feature • Groups of processes • Resource limitations – Like limits.conf but the scope is a set of processes instead of uid/gid • May be nested
  • 9. Cgroups submodules • memory • CPU • network IO • disk IO
  • 11. namespaces • Linux kernel feature • wrap particular global system resource in an abstracted, isolated instance • May be nested
  • 12. Different kinds of namespaces
  • 14.
  • 15. Run Docker container in boot2docker directly
  • 16. Create a container with interactive shell $ docker run -t -i base:centos62 /bin/bash [root@4d8c4b81f6d7 /]# exit (exited) $ -t, --tty Allocate a pseudo-TTY $ -i, --interactive Keep STDIN open even if not attached
  • 17. Check containers’ status $ docker ps (only running containers are shown) $ docker ps –a (all)
  • 18. Reattach in stopped container $ docker start -i 4d8c4b81f6d7 [root@4d8c4b81f6d7 /]#
  • 19. or use docker exec instead $ docker start 4d8c4b81f6d7 $ docker exec –ti 4d8c4b81f6d7 bash [root@4d8c4b81f6d7 /]#
  • 20. Take a look at Docker run command $ docker run -t -i base:centos62 /bin/bash
  • 21. Command + args $ docker run base:centos62 /bin/cat /etc/hosts
  • 22. Name a container $ docker run -ti --name foo base:centos62 /bin/bash $ docker ps -a $ docker rm foo destroy foo container
  • 23. Destroy all containers $ docker rm `docker ps --no-trunc -aq` (except running containers, they must be stopped first) $ docker rm -f `docker ps --no-trunc -aq` (force destroy all containers)
  • 24. Create ephemeral container $ docker run -ti --rm base:centos62 /bin/bash [root@4d8c4b81f6d7 /]# exit (destroyed upon exit) $ docker ps -a
  • 25. Ports forwarding (publish) $ docker run -ti -p 80:80 base:centos62 /bin/bash # yum install httpd # echo "hello world" > /var/www/html/index.html # service httpd start $ curl localhost:80
  • 26. What does Docker port forwarding do? Windows / OS X boot2docker Container Container 80 80
  • 27. 27 Well, I need to render it in browsers…
  • 28. How about this? Windows / OS X boot2docker Container Container 80 80 80
  • 29. Doable via Vagrant $ vim Vagrantfile
  • 30. The solution Windows / OS X boot2docker Container Container 80 80 80  Docker port forwarding Vagrant port forwarding
  • 31. More about Docker ports forwarding $ docker run -ti -p 80:80 base:centos62 /bin/bash • -p, --publish Publish a container's port to the host • format: – ip:hostPort:containerPort (10.1.1.1:80:80) – ip::containerPort (10.1.1.1::80) – hostPort:containerPort (80:80)
  • 32. Volume (like sync folder) $ docker run -ti --name apache -v /httpd-logs:/var/log/httpd base:centos62 /bin/bash # touch /var/log/httpd/foo $ ls /http-logs
  • 33. Volume from other container (useful to share data) $ docker run -ti --volumes-from apache base:centos62 /bin/bash # ls /var/log/httpd
  • 34. Link $ docker run -ti --link apache:apache.trendmicro.com base:centos62 /bin/bash # cat /etc/hosts • Exposes information from source container to recipient container in two ways: – Environment variables – Updating the /etc/hosts file • format: – name:alias
  • 35. useful in multi-node situation 12/25/2014 service (hadoop-client) data (hadoop-client) link
  • 36. Docker in client/server mode Windows / OS X boot2docker (Docker client) Linux server Docker Engine Container Container
  • 37. Server: bind Docker engine to a tcp port $ docker -d -H 10.1.1.1:2375 -H unix:///var/run/docker.sock • -d, --daemon daemon mode • -H, --host the socket(s) to bind in daemon mode
  • 38. Docker client $ export DOCKER_HOST=tcp://10.1.1.1:2375 $ docker images $ docker run -ti --rm centos:centos6 /bin/bash (start container on the server) • Note: – expose tcp port could let someone get root access to the host – not recommended in open network
  • 39. Running containers in background (Detached mode) $ hadoop=$(docker run -d -p 50070:50070 tmh6:centos62) $ docker inspect $hadoop
  • 41. Some other VM-like operations $ docker stop $hadoop $ docker start $hadoop $ docker kill $hadoop $ docker rm $hadoop https://docs.docker.com/reference/commandline/cli/
  • 43. 43 There are two ways to build docker images
  • 44. First: commit an existing container • Do changes manually, then commit  quick and dirty  suitable for experiment  might be deleted in the future
  • 45. Second: Build from Dockerfile • Dockerfile is a series of instructions • Use "Docker build" command to build images • pros: – build images automatically by following instructions – visible and easy to understand instructions – enable Docker specific functions in the image – repeatability
  • 46. A sample httpd service Dockerfile FROM base:centos62 COPY index.html /var/www/html/index.html RUN yum -y install httpd EXPOSE 80 CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]
  • 47. Build $ mkdir apache-server $ cd apache-server $ echo "our first docker image" > index.html $ vi Dockerfile (paste the sample and save it) $ docker build -t apache:0.1 ./
  • 48. Build context • docker build -t apache:0.1 ./ • ./ will be transferred to Docker daemon as build context • Must have a Dockerfile there – ./Dockerfile • DO NOT build at / – docker build -t apache:0.1 /
  • 49. Run the apache image $ docker run -d --name apache apache:0.1 $ docker run -ti --rm --link apache:a01 base:centos62 /bin/bash # curl $A01_PORT_80_TCP_ADDR (you see how link and expose work together)
  • 50. 50 Use entrypoint to bind a specific executable to the image
  • 51. An httpd service example FROM base:centos62 COPY index.html /var/www/html/index.html RUN yum -y install httpd EXPOSE 80 ENTRYPOINT ["/usr/sbin/httpd"] CMD ["-D", "FOREGROUND"]
  • 52. The difference $ docker run -ti --rm apache:0.1 /bin/bash # (get into the container) $ docker run -ti --rm apache:0.2 /bin/bash show httpd helper message  the only thing you can do is to pass args to httpd
  • 53. Make sure init script always being executed FROM base:centos62 … ENTRYPOINT ["init_wrapper_script"] CMD ["default_args"] https://docs.docker.com/articles/dockerfile_best-practices/
  • 55. Tagging an image $ docker tag -h • dockerhub.evansye.com/base:centos62 – REGISTRYHOST = dockerhub.evansye.com – NAME = base – TAG = centos62
  • 57.
  • 58. Redis $ docker run -d --name some-redis redis $ docker run -ti --rm --link some-redis:redis redis /bin/bash # redis-cli -h $REDIS_PORT_6379_TCP_ADDR -p $REDIS_PORT_6379_TCP_PORT https://registry.hub.docker.com/_/redis/
  • 59. MySQL $ docker run -d --name some-mysql -e MYSQL_ROOT_PASSWORD=demo mysql $ docker run -it --link some-mysql:mysql --rm mysql sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"' https://registry.hub.docker.com/_/mysql/
  • 60. Jenkins $ docker run -d -p 8080:8080 Jenkins http://HOST_IP:8080 https://registry.hub.docker.com/_/jenkins/
  • 61. Private Docker registry $ docker run -d -p 5000:5000 registry $ docker tag IMAGE HOST_IP:5000/NAME:TAG $ docker push HOST_IP:5000/NAME:TAG https://registry.hub.docker.com/_/registry/
  • 63. Recap docker run • we’ve learned: – port forwarding – volume mounting – linking containers together – running containers at remote
  • 64. Recap docker build • we’ve learned: – how to write a Dockerfile – how expose and link work together – use entrypoint to bind a specific executable with image – ship images to the registry
  • 66. Re-associate Vagrant with VM • VBoxManage list vms • cd .vagrant/machines/docker- platform/virtualbox/ • touch id • echo 33ca… > id

Notes de l'éditeur

  1. Check the browser
  2. Check the browser
  3. Check the browser
  4. Check the browser
  5. Check the browser
  6. Check the browser
  7. Check the browser
  8. Check the browser
  9. Check the browser
  10. Check the browser
  11. Check the browser
  12. Check the browser
  13. Check the browser
  14. Check the browser
  15. Check the browser