Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
STNSとDocker
Search
Kazuhiko Yamashita
April 23, 2016
1
1.5k
STNSとDocker
Kazuhiko Yamashita
April 23, 2016
Tweet
Share
More Decks by Kazuhiko Yamashita
See All by Kazuhiko Yamashita
Re:Define 可用性を支える モニタリング、パフォーマンス最適化、そしてセキュリティ
pyama86
9
5.6k
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.5k
Tuning GraphQL on Rails
pyama86
2
1.6k
ttlcacheのここがスゴい
pyama86
1
110
クラウドサービスの 利用コストを削減する技術 - 円安の真南風を感じて -
pyama86
3
540
実践ARMアーキテクチャ移行
pyama86
2
2.3k
リモートワーク時代の守護神 PHP開発者のためのセキュリティ強化術
pyama86
3
1.1k
実践DevSecOps~クラウドネイティブとオンプレミスの間から~
pyama86
1
93
ペパボOpenTelemetry革命
pyama86
2
2.1k
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
Automating Front-end Workflow
addyosmani
1367
200k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
270
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.5k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
Statistics for Hackers
jakevdp
797
220k
Designing for humans not robots
tammielis
250
25k
Transcript
य़ͷཅؾʹ༠ΘΕͯ STNSͱDocker
hi! GMO Pepabo, Inc. ϗεςΟϯάࣄۀ෦ ϜʔϜʔυϝΠϯάϧʔϓ γχΞΤϯδχΞ @pyama86
STNS ɾLinuxϢʔβʔɺάϧʔϓͷ໊લղܾ ɾSSHϩάΠϯ࣌ͷެ։伴ͷऔಘ ɾSudoύεϫʔυͷೝূ
STNS ɾTOMLܗࣜͷઃఆϑΝΠϧ ɹˠγϯϓϧͳཧ ɾrhel,debianͷϦϙδτϦఏڙ ɾx86_64,i386ͷαϙʔτ [users.example] id = 1001 group_id
= 1001 keys = ["ssh-rsa XXXXX…"] [groups.example] id = 1001 users = ["example"]
ෳڥΛαϙʔτ ↓ ӡ༻ෛՙ͕ߴ·Δ
LinuxϛυϧΣΞͷ߹ ɾෳͷOSɾΞʔΩςΫνϟͰͷಈ࡞Λอূ ɾෳͷܗࣜͷύοέʔδϯάʹରԠ(rpm,deb) ɾLinuxͷࠜװͷػೳͰ͋ΔͨΊαʔϏεஅ ڐ͞Εͳ͍
ϦϦʔεϑϩʔ 1.push 2.webhook 3.CI 4.test deploy 5.install test 6.integration test
7.producion deploy
Docker
ϦϦʔεϑϩʔ 1.push 2.webhook 3.CI 4.test deploy 5.install test 6.integration test
7.producion deploy Docker
ׂ͝ͱʹΠϝʔδΛ͚Δ rhel-x86-build rhel-x86-test rhel-x86-pkg rhel-i386-build rhel-i386-test rhel-i386-pkg debian-x86-build debian-x86-test debian-x86-pkg
debian-i386-build debian-i386-test debian-i386-pkg rhel-x86-chef rhel-i386-chef debian-x86-chef debian-i386-chef 16ύλʔϯ×2(server,client)
DRY
Base STEP1:ΠϝʔδཧΛೋஈ֊ʹ rhel-x86 rhel-i386 debian-i386 debian-x86 Πϯετʔϧ͢ΔϛυϧΣΞ ෦ઃఆΛἧ͑ɺΞʔΩςΫνϟ ʹґଘ͠ͳ͍ૢ࡞ΛՄೳͱ͢Δ concreate
rhel-x86-build rhel-x86-test rhel-x86-pkg rhel-i386-build rhel-i386-test rhel-i386-pkg debian-x86-build debian-x86-test debian-x86-pkg debian-i386-build debian-i386-test debian-i386-pkg ϕʔεΠϝʔδ͔Βׂ͝ͱʹ ΠϝʔδΛ࡞͢Δ
STEP2:ERBͰDockerfileͰग़དྷΔ͜ͱΛ૿͢ ɾdocker/centos-ci.erb DockerfileͷFROMʹมΛࢦఆͰ͖ͳ͍ͷͰ ERBͰςϯϓϨʔτԽ͢Δ
STEP3:RakeͰBuild͢Δ ɾRakefile Rake Ruby Ͱॻ͔ΕͨϏϧυπʔϧɻ ERBͱ߹ΘͤΔ͜ͱͰॏෳΛݮΒ͠ɺλεΫΛఆٛ͢Δ͜ͱ͕ग़དྷ·͢ɻ
Dockerfile rhel-x86-build rhel-x86-test rhel-x86-pkg rhel-i386-build rhel-i386-test rhel-i386-pkg debian-x86-build debian-x86-test debian-x86-pkg
debian-i386-build debian-i386-test debian-i386-pkg bin/rake build bin/rake test bin/rake pkg ׂ͝ͱʹ1ίϚϯυͰશͯͷOSɺ ΞʔΩςΫνϟͰ࣮ߦͰ͖ΔΑ͏ʹͳΔ
͞Βʹ
Travis CIͳΒDockerಈ͘ ɾύοέʔδ࡞ ɾΠϯετʔϧ ɾServerspecͰల։ޙͷঢ়ଶΛςετ ɹ →ෳͷOSɺෳͷΞʔΩςΫνϟΛCI
࠷ޙʹ ɾDockerΛར༻͢ΔͱෳͷڥΛखܰʹ४උ͢Δ ͜ͱ͕ग़དྷΔ͕ɺखܰ͞Ώ͑ʹDRYݪଇʹ͕ͪ͠ ɾRakeͱΈ߹Θͤɺಉ͡ఆٛΛߦΘͳ͍ ɾϕʔεΠϝʔδͱ۩Πϝʔδͷೋஈ֊ʹ͚Δ ͜ͱͰπʔϧͱΈ߹Θͤ͘͢ͳΔ ɾSTNSɺຊʹศར͔ͩΒͬͨ΄͏͕͍͍
͓ෲ͍ͨ͢ΆΑ