Upgrade to Pro — share decks privately, control downloads, hide ads and more …

dockerって何

 dockerって何

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

Masato Oshima

June 16, 2014
Tweet

More Decks by Masato Oshima

Other Decks in Programming

Transcript

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

    Windows VirtualBox / VMWare CentOS6.5 Docker CentOS CentOS ͜ͷลΓΛͬ͘͞ͱ΍Δπʔϧ ͸ެࣜͰ༻ҙ͞ΕͯΔ
  2. Q: Ͳ͏΍ͬͯDockerىಈ͢Δ ͷ? # service docker start ࣾச͓ͳ͡ΈͷϓϩΩγ΋OK(^o^)b # vim

    /etc/sysconfig/docker export http_proxy=“ϓϩΩγURL” • σʔϞϯͰىಈͯ͠ίϚϯυΛ଴ͪड͚Δ CentOS6.5 σʔϞϯͰىಈ͍ͯ͠Δ%PDLFS ͞Μʹ৭ʑͳ໋ྩΛग़͢
  3. # docker images REPOSITORY: centos TAG: latest IMAGE ID: 0c752394b855

    CREATED: 2 days ago VIRTUAL SIZE: 124.1 MB Cent OS 6.5 w ϩʔΧϧͰ؅ཧ͍ͯ͠ΔΠϝʔδ ͷ৘ใΛڭ͑ͯ͘ΕΔ
  4. # 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Ͱର࿩͢Δ
  5. # 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
  6. # docker commit de3b79315a19 mpon/centos Cent OS 6.5 centos Cent

    OS 6.5 mpon/centos Vim w WJNΛΠϯετʔϧͨ͠ίϯςφΛίϛοτ w ίϯςφΛίϛοτ͢ΔͱΠϝʔδʹͳΔ w Πϝʔδ͔ΒͳΒίϯςφ͸ىಈͰ͖Δ
  7. # 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
  8. # 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
  9. # 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
  10. 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
  11. 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
  12. 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
  13. 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