140810_Docker-Docker.Hub

 140810_Docker-Docker.Hub

140810 珠海 金山 内部分享中
马道长的分享

6002ee051e03f0b762642ee7fafd111f?s=128

Zoom.Quiet

August 12, 2014
Tweet

Transcript

  1. Docker & Docker Hub

  2. 1. Docker Chinese community 2. Docker & Docker Governance 3.

    Namespaces & Cgoups 4. Storage Drive Kernel -> AUFS 5. Docker Hub & Docker Registry 6. Docker Registry API 7. Community Version Docker Hub 8. Docker Remote API 9. Dockerfile 10. OpenSource Projects Base Docker Agenda
  3. Who am I ? ⻢马全⼀一 Meaglith Ma Docker 中⽂文社区创始⼈人 dockboard.org

    & docker.cn [微博] @⻢马全⼀一 [G+] google.com/+MeaglithMa [Twitter] @genedna [Email] genedna@gmail.com [Book] Docker Open Book github.com/ genedna/dockeropenbook
  4. About Docker Community in China dockboard.org https://github.com/dockboard

  5. None
  6. System Virtualization VS Container Virtualization Hardware' Host'Kernel' Hypervisor(VMM)' Guest' Kernel'

    Binaries/' Libraries' App' System Virtualization Guest' Kernel' Binaries/' Libraries' App' Guest' Kernel' Binaries/' Libraries' App' Hardware' Host'Kernel' Binaries/' Libraries' App' Binaries/' Libraries' App' Binaries/' Libraries' App' Container Virtualization
  7. What’s Docker ? Docker Hub +

  8. DGAB -> Docker Governance Advisory Board 1.DGAB or Fond? 2.Seats

    for commit, no fee or sponsorship. 3.Membership for 12 months, 24 months max. 4.DGAB is not charge.
  9. How to use Docker?

  10. What’s namespaces? pid net ipc mnt uts user 1. pid

    namespace 2. net namespace 3. mnt namespace 4. uts namespace 5. ipc namespace
  11. 1. CPU 2. Memory 3. Blkio 4. Net_cls 5. Net_prio

    6. Device What’s cgroups
  12. What’s AUFS? /base boot bin lib lib64 usr sbin /data

    www /union boot bin lib lib64 usr sbin www mount -t aufs -o br=/base=ro:/data=rw none /union
  13. Docker Local Storage Path -> /var/lib/docker diff 842b5a724d2d) f106b5d7508a) 1e8abad02296)

    511136ea3c5a) …) layer 842b5a724d2d) f106b5d7508a) 1e8abad02296) 511136ea3c5a) …) mnt 842b5a724d2d) f106b5d7508a) 1e8abad02296) 511136ea3c5a) …) mount -t aufs –o br= diff/511136ea3c5a=ro: diff/1e8abad02296=ro: diff/f106b5d7508a=ro: diff/842b5a724d2d=rw none mnt/842b5a724d2d
  14. Docker Hub & Registry Workflow

  15. How To Deploy Docker Registry? docker run -p 5000 samalba/docker-registry

    https://github.com/dotcloud/docker-registry
  16. EPDLFSぢ)6#剪⸉㐼岤ⱃSFQPTJUPSZ165WSFQPTJUPSJFTVTFSOBNFSFQPTJUPSZ ⿬侨僽+40/呔䒭涸SFQPTJUPSZ䨾剣JNBHF涸JE⴩邍䭽撑JNBHF涸匬䒊곡䎸䱗⴩կ 呏䰘SFQPTJUPSZ涸UBHT鵳遤䗄梠 蜦》JNBHF涸+40/俒⟝(&5WJNBHFTJNBHF@JEKTPO 㥵卓尵剣姼俒⟝䧴ⰻ㺂鵥㔐կ EPDLFSQVTI雩⚹剪⸉㐼尵剣JNBHF㼆䎾涸俒⟝ぢ剪⸉㐼♳⠛JNBHF湱Ⱒ俒⟝կ ⱗⰆJNBHF涸+40/俒⟝165WJNBHFTJNBHF@JEKTPO ⱗⰆJNBHF涸MBZFS俒⟝165WJNBHFTJNBHF@JEMBZFS ⱗⰆJNBHF涸DIFDLTVN⥌䜂165WJNBHFTJNBHF@JEDIFDLTVN ♳⠛㸤姼UBH涸䨾剣JNBHFたぢ剪⸉㐼ⱗⰆUBH⥌䜂165WSFQPTJUPSJFT

    OBNFTQBDF  SFQPTJUPSZ UBHT UBH  䨾剣UBHT涸JNBHF♳⠛㸤䧭たぢ剪⸉㐼〄鷐䨾剣JNBHFT涸吥낉⥌䜂165W SFQPTJUPSJFT OBNFTQBDF  SFQP@OBNF JNBHFT Docker Registry API -> Push
  17. Docker Registry API -> Pull EPDLFS霄꡼)VC剪⸉㐼SFQPTJUPSZ涸JNBHFT⥌䜂(&5WSFQPTJUPSJFTVTFSOBNF SFQPTJUPSZJNBHFT EPDLFS霄꡼SFHJTUSZ剪⸉㐼SFQPTJUPSZ涸UBHT⥌䜂(&5WSFQPTJUPJFTVTFSOBNF SFQPTJUPSZUBHT 呏䰘SFQPTJUPSZ涸UBHT⚥JNBHF⥌䜂鵳遤䗄梠

    蜦》JNBHF涸"ODFTUSZ⥌䜂(&5WJNBHFTJNBHF@JEBODFTUSZ 蜦》JNBHF涸+40/侨䰘(&5WJNBHFTJNBHF@JEKTPO 蜦》JNBHF涸-BZFS俒⟝(&5WJNBHFTJNBHF@JEMBZFS
  18. Golang Version Docker Registry

  19. Docker Remote API -> Image & Container 1045JNBHFTDSFBUF (&5JNBHFT OBNF

    IJTUPSZ 1045JNBHFT OBNF JOTFSU (&5JNBHFT OBNF KTPO (&5JNBHFTKTPO 1045JNBHFT OBNF QVTI %&-&5&JNBHFT OBNF  (&5JNBHFTTFBSDI 1045JNBHFT OBNF UBH 1045DPOUBJOFST JE BUUBDI (&5DPOUBJOFST JE DIBOHFT 1045DPOUBJOFST JE DPQZ 1045DPOUBJOFSTDSFBUF (&5DPOUBJOFST JE FYQPSU (&5DPOUBJOFST JE KTPO 1045DPOUBJOFST JE LJMM (&5DPOUBJOFSTKTPO (&5DPOUBJOFST JE MPHT 1045DPOUBJOFST JE QBVTF %&-&5&DPOUBJOFST JE  1045DPOUBJOFST JE SFTUBSU 1045DPOUBJOFST JE TUBSU 1045DPOUBJOFST JE TUPQ (&5DPOUBJOFST JE UPQ 1045DPOUBJOFST JE VOQBVTF 1045DPOUBJOFST JE XBJU
  20. # VERSION 0.1 # DOCKER-VERSION 0.7.3 # AUTHOR: Sam Alba

    <sam@docker.com> # DESCRIPTION: Image with docker-registry project and dependecies # TO_BUILD: docker build -rm -t registry . # TO_RUN: docker run -p 5000:5000 registry # Latest Ubuntu LTS from ubuntu:14.04 # Update run apt-get update run apt-get -y upgrade # Install pip run apt-get -y install python-pip # Install deps for backports.lzma (python2 requires it) run apt-get -y install python-dev liblzma-dev libevent1-dev add . /docker-registry add ./config/boto.cfg /etc/boto.cfg # Install core run pip install /docker-registry/depends/docker-registry-core # Install registry run pip install file:///docker-registry#egg=docker-registry[bugsnag] env DOCKER_REGISTRY_CONFIG /docker-registry/config/config_sample.yml env SETTINGS_FLAVOR dev expose 5000 cmd exec docker-registry What’s Dockerfile ?
  21. OpenSource Projects Base Docker 1.PaaS : Tsuru/Octohost/Deis/StackDock/Flynn/ tusum/Dokku/Spin-Docker/Peas/Tutum 2.Private Registry:

    quay.io/orchard/docker.cn 3.OS: CoreOS/Atomic 4.CI: Drone/Shippable 5.Book: dockerbook.com 6.Kubernetes
  22. End & Thanks