$30 off During Our Annual Pro Sale. View Details »
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
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.3k
Tuning GraphQL on Rails
pyama86
2
1.3k
ttlcacheのここがスゴい
pyama86
1
82
クラウドサービスの 利用コストを削減する技術 - 円安の真南風を感じて -
pyama86
3
490
実践ARMアーキテクチャ移行
pyama86
2
2.2k
リモートワーク時代の守護神 PHP開発者のためのセキュリティ強化術
pyama86
3
1k
実践DevSecOps~クラウドネイティブとオンプレミスの間から~
pyama86
1
73
ペパボOpenTelemetry革命
pyama86
2
2k
Site Reliability Engineering for GMO
pyama86
10
1.3k
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
21
1.2k
Bash Introduction
62gerente
608
210k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Unsuck your backbone
ammeep
669
57k
Navigating Team Friction
lara
183
15k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
110
49k
It's Worth the Effort
3n
183
27k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
How GitHub (no longer) Works
holman
310
140k
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ɺຊʹศར͔ͩΒͬͨ΄͏͕͍͍
͓ෲ͍ͨ͢ΆΑ