Save 37% off PRO during our Black Friday Sale! »

dockerって何

 dockerって何

dockerがなんとなーくしか分からなかったので調べた。
社内開発合宿用の発表資料
参考:
地獄のミサワ http://jigokuno.com/?eid=1011
大体いい感じになるKeynoteテンプレート https://github.com/sanographix/azusa-keynote

E3d96b25e645921d9e5acbaa36c507a5?s=128

Masato Oshima

June 16, 2014
Tweet

Transcript

  1. dockerͬͯԿ @_mpon ։ൃ߹॓#3 ൃදࢿྉ

  2. ͳΜ͔Α͘෼͔ͬͯͳ͍͚Ͳ VMWareΈ͍ͨʹ Ծ૝ԽͰ͖Δ΍ͭͰ͠ΐʁ(ద౰)

  3. None
  4. None
  5. ಡΉ͚ͩ͡Ό Α͘෼͔Βͳ͍

  6. ͬ͘͟Γݴ͏ͱ%PDLFSͬ ͳΜͳͷʁ %PDLFS͸Ͳͷ؀ڥ Ͱ΋ಈ͘ͷʁ ͲΜͳ04Ͱ΋Ծ૝Խ Ͱ͖Δͷʁ Ͳ͏΍ͬͯ%PDLFSΠϯε τʔϧ͢Δͷ ϗετ04ͱಉ͡-JOVY͠ ͔Ծ૝ԽͰ͖ͳ͍ͷʁ

    Ͳ͏΍ͬͯ%PDLFS ىಈ͢Δͷ
  7. Πϯετʔϧͯ͠ΈͨΒ ͳΜͱͳ͘෼͔ͬͨ

  8. Q: ͬ͘͟Γݴ͏ͱDocker ͬͯͳΜͳͷʁ • LinuxͷػೳΛ࢖ͬͯԾ૝؀ڥΛ࡞ͬͯ؅ཧ͢ Δͱ͜Ζ·ͰΛ͍͍ײ͡ʹ΍ͬͯ͘ΕΔGoݴ ޠͷιϑτ΢ΣΞ Ծ૝؀ڥ Ծ૝؀ڥ Ծ૝؀ڥ

    -JOVYͷػೳ
  9. Q: Docker͸Ͳͷ؀ڥͰ΋ಈ ͘ͷʁ • Linuxͷ࢓૊ΈΛ࢖ͬͯΔ͔ΒLinuxͰ͔͠ ಈ͔ͳ͍

  10. Q: Docker͸Ͳͷ؀ڥͰ΋ಈ ͘ͷʁ • Mac΍Windows͸Ծ૝ϚγϯΛཱͯΔඞཁ ͕͋Δ Mac OS X /

    Windows VirtualBox / VMWare CentOS6.5 Docker CentOS CentOS ͜ͷลΓΛͬ͘͞ͱ΍Δπʔϧ ͸ެࣜͰ༻ҙ͞ΕͯΔ
  11. Q: ͲΜͳOSͰ΋Ծ૝ԽͰ͖ Δͷʁ • Linuxͷ࢓૊ΈΛ࢖ͬͯΔ͔ΒLinux͔͠Ծ ૝ԽͰ͖ͳ͍

  12. Q: ϗετOSͱಉ͡Linux͔͠ Ծ૝ԽͰ͖ͳ͍ͷʁ • ϗετOSͱಉ͡͡Όͳͯ͘΋OK • ྫ: CentOS্ͷDockerʹUbuntu CentOS6.5 Docker

    CentOS6.4 CentOS6.5 Ubuntu14 Debian
  13. Q: Ͳ͏΍ͬͯDockerΠϯε τʔϧ͢Δͷ? # yum -y install docker-io • CentOS6.5ͳΒEPELܦ༝ͰyumͰͰ͖Δ

    Πϯετʔϧ͸ͨͬͨ͜Ε͚ͩ
  14. Q: Ͳ͏΍ͬͯDockerىಈ͢Δ ͷ? # service docker start ࣾச͓ͳ͡ΈͷϓϩΩγ΋OK(^o^)b # vim

    /etc/sysconfig/docker export http_proxy=“ϓϩΩγURL” • σʔϞϯͰىಈͯ͠ίϚϯυΛ଴ͪड͚Δ CentOS6.5 σʔϞϯͰىಈ͍ͯ͠Δ%PDLFS ͞Μʹ৭ʑͳ໋ྩΛग़͢
  15. Dockerͷ࢓૊Έ • ࣮ࡍʹDockerͷίϚϯυΛൃߦ͠ͳ͕Β֬ ೝ͍͖ͯ͠·͢ • Πϝʔδͱίϯςφͱ͍͏֓೦͕Dockerͷ ಛ௃Ͱ͢

  16. http://docs.docker.com/terms/container/

  17. # docker pull centos DockerHub Cent OS 6.5 w Ծ૝؀ڥͷݩͱͳΔ΋ͷΛμ΢ϯϩʔυ

    w %PDLFSͰ͸͜ΕΛΠϝʔδͱݺͿ
  18. # docker images REPOSITORY: centos TAG: latest IMAGE ID: 0c752394b855

    CREATED: 2 days ago VIRTUAL SIZE: 124.1 MB Cent OS 6.5 w ϩʔΧϧͰ؅ཧ͍ͯ͠ΔΠϝʔδ ͷ৘ใΛڭ͑ͯ͘ΕΔ
  19. ͔͜͜ΒDockerͰ Ծ૝؀ڥΛ࡞͍͖ͬͯ·͢

  20. # docker run -i -t centos /bin/bash bash-4.1# Cent OS

    6.5 centos Cent OS 6.5 ίϯςφID(de3b79315a19) w ΠϝʔδΛ΋ͱʹԾ૝؀ڥΛىಈ w %PDLFSͰ͸ͦΕΛίϯςφͱݺͿ w ίϯςφ্Ͱىಈͨ͠CBTIͰର࿩͢Δ
  21. # docker run -i -t centos /bin/bash bash-4.1# yum install

    vim # exit Cent OS 6.5 centos Cent OS 6.5 ίϯςφID(de3b79315a19) Vim w ىಈͨ͠ίϯςφͰWJNΛΠϯετʔϧ w Πϯετʔϧ͕ऴΘͬͨΒίϯςφΛऴྃ w FYJUͨ͠ίϯςφ͸΋͏ىಈͰ͖ͳ͍ʂ JNNVUBCMF
  22. # docker commit de3b79315a19 mpon/centos Cent OS 6.5 centos Cent

    OS 6.5 mpon/centos Vim w WJNΛΠϯετʔϧͨ͠ίϯςφΛίϛοτ w ίϯςφΛίϛοτ͢ΔͱΠϝʔδʹͳΔ w Πϝʔδ͔ΒͳΒίϯςφ͸ىಈͰ͖Δ
  23. # docker run run -i -t mpon/centos /bin/bash bash-4.1# yum

    install httpd # exit w ίϛοτͨ͠ΠϝʔδΛ΋ͱʹίϯςφΛىಈ w ίϯςφ্ͰBQBDIFΛΠϯετʔϧ Cent OS 6.5 ίϯςφID(261da8325c1a) apache Cent OS 6.5 centos Cent OS 6.5 mpon/centos Vim
  24. # docker run run -i -t centos /bin/bash bash-4.1# yum

    install emacs httpd # exit w ͞Βʹ࠷ॳͷΠϝʔδΛ΋ͱʹผͷ ίϯςφΛىಈ w ίϯςφ্ͰFNBDTͱBQBDIFΛΠ ϯετʔϧ Cent OS 6.5 261da8325c1a apache Cent OS 6.5 centos Cent OS 6.5 mpon/centos Vim Cent OS 6.5 49cabb224d32 emacs apache Cent OS 6.5 centos
  25. # docker commit 261da8325c1a mpon/centos-vim # docker commit 49cabb224d32 mpon/centos-emacs

    w ֤ίϯςφΛίϛοτ w WJNόʔδϣϯɺFNBDTόʔδϣ ϯͷ৭ʑͳΠϝʔδ͕࡞੒Ͱ͖· ͨ͠ʂʂ Cent OS 6.5 mpon/centos-vim apache Cent OS 6.5 Cent OS 6.5 mpon/centos Vim Cent OS 6.5 mpon/centos-emacs emacs apache Cent OS 6.5
  26. Q: ͪͳΈʹىಈͨ͠centos ͷத͸Ͳ͏ͳͬͯΔʁ # docker run -i -t centos /bin/bash

    ! bash-4.1# cat /etc/redhat-release CentOS release 6.5 (Final) ! bash-4.1# ls / bin dev etc home lib lib64 lost+found media mnt opt proc root sbin selinux srv sys tmp usr var ! bash-4.1# whoami root
  27. Docker·ͱΊ • Ծ૝Ϛγϯͱ͸ҧ͏ • Linux؀ڥΛԾ૝Խ͢Δ • Πϯετʔϧ؆୯ • Πϝʔδͱίϯςφ

  28. Cent OS 6.5 mpon/centos-vim apache Cent OS 6.5 Cent OS

    6.5 mpon/centos Vim Cent OS 6.5 mpon/centos-emacs emacs apache Cent OS 6.5
  29. Cent OS 6.5 mpon/centos-vim apache Cent OS 6.5 Cent OS

    6.5 mpon/centos Vim Cent OS 6.5 mpon/centos-emacs emacs apache Cent OS 6.5
  30. Cent OS 6.5 mpon/centos-vim apache Cent OS 6.5 Cent OS

    6.5 mpon/centos Vim Cent OS 6.5 mpon/centos-emacs emacs apache Cent OS 6.5
  31. None
  32. None
  33. None