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

ミニマリストのためのAlpine

 ミニマリストのためのAlpine

Alpine Linux Meetup Tokyo #1
2016/04/21

9da3e55b63eadb238fb34882ca08e27b?s=128

A.K.A Tony Morris

April 21, 2016
Tweet

More Decks by A.K.A Tony Morris

Other Decks in Programming

Transcript

  1. ϛχϚϦετͷͨΊͷ "MQJOF "MQJOF-JOVY.FFUVQ5PLZP

  2. ࣗݾ঺հ w τχʔϞϦε͸ϏδωεωʔϜ w ຊ໊͸ฏా஌ٛ w *5ؔ࿈ͷձࣾۈ຿ w ࣄۀձࣾ޲͚ʹ4ZTUFN*OUFHSBUJPOΛߦ͏૊৫ʹॴଐ w

    %8)ɺ#VTJOFTT*OUFMMJHFODFͷ࢓ࣄ͕ϝΠϯ w ྲྀߦͷݴ༿Ͱݴ͏ͱɺ#JH%BUBͱ͔"OBMZUJDT w ৬छ͸ϓϩδΣΫτϚωʔδϟʔ·ͨ͸ΞʔΩςΫτʢϓϩδΣΫτʹΑΔʣ w ΞϓϦέʔγϣϯ͔Πϯϑϥ͔ͱݴͬͨΒɺΞϓϦέʔγϣϯ୲౰
  3. #MVF.JYʹ͓͚Δ%PDLFS w *#.ͷΫϥ΢υαʔϏε#MVF.JYͰ͸1BB4ɺ7.ͱฒͼɺ%PDLFSϕʔεͷαʔϏε͕ఏڙ͞Ε͍ͯΔ

  4. #MVF.JYʹ͓͚Δ%PDLFS w *#.ͷΫϥ΢υαʔϏε#MVF.JYͰ͸%PDLFSΠϝʔδ͕ఏڙ͞Ε͍ͯΔ w ࣌఺Ͱ#MVF.JYʹϩάΠϯ͢ΔͱɺԼهͷΠϝʔδ͕ఏڙ͞Ε͍ͯͨ

  5. %FWFMPQFS8PSLTͰνϡʔτϦΞϧɺΨΠυ ͕ެ։͞Ε͍ͯΔͷͰɺͥͻ͝ཡ͍ͩ͘͞ https://www.ibm.com/developerworks/jp/cloud/library/cl-bluemix-minecraft-docker-trs-1/

  6. "MQJOFΛࣗ୐ͷαʔόʔʹಋೖͯ͠ΈΔ IUUQXJLJBMQJOFMJOVYPSHXJLJ*OTUBMMBUJPO "MQJOFͷಋೖ͸͜ͷϦϯΫઌͷखॱͰ໰୊ͳ͠ ಋೖ௚ޙͷσΟεΫͷঢ়ଶ͸͜Μͳײ͡

  7. ͦ͜ʹ%PDLFSΛಋೖͯ͠ΈΔ "MQJOFʹ%PDLFSͷύοέʔδ͕͋Δ IUUQTQLHTBMQJOFMJOVYPSHQBDLBHFT OBNFEPDLFSCSBODIWSFQPBSDINBJOUBJOFS ͳͷͰɺ BQLBEEEPDLFS Λ࣮ߦ͢Ε͹0,

  8. ॳΊͯͷEPDLFSSVO

  9. QVMMͯ͠ΈΔ w ৭ʑͱ
 QVMMͯ͠Έͨ w ۤ࿑ͨ͠ͷ͸͜ͷΤϥʔ IUUQGPSVNBMQJOFMJOVYPSHGPSVNHFOFSBMEJTDVTTJPOXJOEPXTBMQJOFEPDLFSDPNNFOU w ͜͜ʹॻ͍ͯ͋ΔखॱͰղܾ #!/bin/sh

    apk add docker sysctl -w kernel.grsecurity.chroot_deny_chmod=0 sysctl -w kernel.grsecurity.chroot_deny_mknod=0 service docker start sleep 5 docker --version docker pull hello-world docker pull alpine docker images localhost:/media# docker pull ianblenke/xfce Using default tag: latest latest: Pulling from ianblenke/xfce a3ed95caeb02: Pull complete aac0c133338d: Extracting 2.235 MB/2.235 MB 762372f10b38: Download complete failed to register layer: ApplyLayer exit status 1 stdout: stderr: chmod /bin/bbsuid: permission denied failed to register layer: ApplyLayer exit status 1 stdout: stderr: chmod /bin/mount: permission denied localhost:~# docker images REPOSITORY TAG IMAGE ID CREATED SIZE docker latest 3c926f66728e 2 days ago 75.7 MB frolvlad/alpine-python3 latest 88404569db3b 9 days ago 58.06 MB frolvlad/alpine-go latest b0840d40aade 2 weeks ago 179.1 MB frolvlad/alpine-bash latest f30b8e53e1ea 2 weeks ago 14.78 MB jazzdd/alpine-flask latest b1bfa267edec 2 weeks ago 80.21 MB alpine latest d7a513a663c1 2 weeks ago 4.794 MB x11docker/lxde latest 1398a64f70a6 6 months ago 423.2 MB ianblenke/xfce latest b3c21c878fb2 12 months ago 470.5 MB
  10. EFTLUPQ؀ڥͷߏஙʹ௅ઓɹ὎ɹஅ೦ w ʮϛχϚϦετͷͨΊͷʯͱ͍͏ςʔϚʹԊͬͯɺϛχϚϧͳ࡞ۀ؀ڥΛ ߏங͠Α͏ͱࢼΈ͕ͨɺ9TFSWFSपΓͰΤϥʔͱͳΓɺஅ೦ɻ

  11. չ͍͠ͷͰ͜Μͳ͜ͱΛ w ίϚϯυϥΠϯ্ʹը૾Λදࣔ
 JNHUYUίϚϯυ
 ˞ຊ౰͸໐ͬͯ·ͤΜ w ίϚϯυϥΠϯ্ͰNQ࠶ੜ
 NQH BQLͰJOTUBMM w

    $6*ͷϒϥ΢β
 MZOY BQLͰJOTUBMM
  12. 3BTQCFSSZ1JͰ΋΍ͬͯΈͨ w ͜ͷαΠτͷखॱͰ"MQJOFΛΠϯετʔϧ
 IUUQXJLJBMQJOFMJOVYPSHXJLJ3BTQCFSSZ@1J w "3.༻ͷEPDLFSͷύοέʔδ΋͋Γ
 w 3BTQCFSSZ1JͰ΋(6*ߏஙΛஅ೦
 ɾɾɾ9TFSWFSؔ࿈ͷΤϥʔ͕ղফͰ͖ͳ͔ͬͨ IUUQTQLHTBMQJOFMJOVYPSHQBDLBHFT

    OBNFEPDLFSCSBODIWSFQPBSDIBSNIGNBJOUBJOFS $%ͱൺ΂ͯ͜ͷେ͖͞ ແઢ-"/ɺ#MVFUPPUI͕ೖͬͯ=  εΠοναΠΤϯεͰͷՁ֨ 

  13. -FTTPOT-FBSOFE ϔουϨεӡ༻͕લఏ

  14. #VTJOFTT7JFXͰͷ"MQJOF %PDLFS ࣄۀձࣾˍ4ZTUFN*OUFHSBUPSͱ͍͏εΩʔϜͰ ɹ"MQJOF %PDLFSͷల։͸ࠓޙͲ͏ͳΔͷ͔ʁ ʢࢲͷԾઆʣ

  15. ͜Μͳ࣌Ͳ͏͢Δʁ ࣄۀձࣾͷ*5෦໳ͷτοϓɾϚωδϝϯτ͕ ʮ͜Ε͔Β͸%PDLFSͩΑʯͱݴͬͨΒʁ

  16. ͜Μͳ࣌Ͳ͏͢Δʁ ࣄۀձࣾͷ*5෦໳ͷτοϓɾϚωδϝϯτ͕ ʮ΍͸ΓΦϯɾϓϨϛεͩʯͱݴͬͨΒʁ

  17. ࣄۀձࣾʹͱͬͯ%PDLFS͸༗ӹ͔ʁ w ΞϓϦέʔγϣϯ୲౰ͷݱ৔ΤϯδχΞ͔Β͢Δͱ%PDLFS͸ඇৗʹັྗతʹөΔɻ w ͳͥͳΒɺΠϯϑϥͷ4DSBQ#VJME͕͠΍ͦ͢͏ͰɺԼهͷΑ͏ͳ໰୊ΛղܾͰ͖ͦ͏ɻ 1MBO 3% %FTJHO #VJME%FQMPZ 6"5

    1MBO 3% %FTJHO #VJME%FQMPZ 6"5 "QQ
 5FBN *OGSB
 5FBN 1SPKFDU5JNFMJOF ͜ͷ࣌఺Ͱਖ਼͍͠
 ඇػೳཁ݅ΛܾΊΔͷ͸ඇৗʹࠔ೉ ͜͜Ͱ
 1SPPG0G$PODFQU
 ΍ͬͱ͖͍ͨ ͜ͷ࣌఺Ͱඇػೳཁ͕݅
 ܾ·ͬͯͳ͍ͱ࡞ۀ͕ਐ·ͳ͍ ϛυϧ΢ΤΞͱ04ͷ
 ૬ੑͷ໰୊͕൑໌ ͦΜͳʹ؆୯ʹ
 αʔόʔ࡞Εͳ͍ ࠓ͞Βઃఆมߋ͸ແཧ ύϑΥʔϚϯεͷ
 ໰୊͕൑໌ ඇػೳཁ݅ɺ Ͳ͏ͯ͠
 ͪΌΜͱܾΊͳ͍ͷʁ *OGSBνʔϜͷ੒Ռ෺͸ɺαʔόʔͦͷ΋ͷͱ๲େͳઃఆ஋ϦετɺߏஙखॱॻͰ͋Δɻ
 ͦΕΒͷߋ৽ͱ࠶࣮ࢪ͸ɺϓϩδΣΫτͷίετΛߟ͑Δͱݱ࣮తͰ͸ͳ͍
  18. ࣄۀձࣾʹͱͬͯ"MQJOF͸༗ӹ͔ʁ w γεςϜߏ੒ܾఆʹ͓͍ͯɺٕज़Ҏ֎ͷཁૉ͕઎ ΊΔׂ߹͸ҙ֎ʹେ͖͍ɻ w ࣄۀձࣾٴͼ4*FS͸༗ঈσΟετϦϏϡʔγϣϯ Λ޷Ήɻ͜Ε͸αϙʔτΛٻΊΔͨΊɻ w ϦεΫͷసՇ΋ཧ༝ͷҰ͕ͭͩɺసՇ͔ͨ͠Βͱ ͍ͬͯܰݮ͞ΕΔΘ͚Ͱ͸ͳ͍ɻ

  19. ࣄۀձࣾʹͱͬͯ"MQJOF͸༗ӹ͔ʁ w ʮܰ͞ʯʹϞδϡʔϧͷগͳ͞ w ʮܰ͞ʯʹιʔείʔυͷগͳ͞ ɹɹͱ͍͏͜ͱͳΒɺো֐ൃੜͷϦεΫ͸ܰݮ͞ΕΔ w ϦεΫసՇΑΓܰݮ͕༗ӹͳͷ͸ݴ͏·Ͱ΋ͳ͍ɻ ܰ͞͸ਖ਼ٛ