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
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.4k
Tuning GraphQL on Rails
pyama86
2
1.4k
ttlcacheのここがスゴい
pyama86
1
85
クラウドサービスの 利用コストを削減する技術 - 円安の真南風を感じて -
pyama86
3
510
実践ARMアーキテクチャ移行
pyama86
2
2.3k
リモートワーク時代の守護神 PHP開発者のためのセキュリティ強化術
pyama86
3
1k
実践DevSecOps~クラウドネイティブとオンプレミスの間から~
pyama86
1
76
ペパボOpenTelemetry革命
pyama86
2
2k
Site Reliability Engineering for GMO
pyama86
10
1.3k
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
169
14k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Site-Speed That Sticks
csswizardry
2
190
Designing Experiences People Love
moore
138
23k
Documentation Writing (for coders)
carmenintech
66
4.5k
Producing Creativity
orderedlist
PRO
341
39k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
We Have a Design System, Now What?
morganepeng
51
7.3k
Being A Developer After 40
akosma
87
590k
The Language of Interfaces
destraynor
154
24k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
510
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ɺຊʹศར͔ͩΒͬͨ΄͏͕͍͍
͓ෲ͍ͨ͢ΆΑ