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
コンテナをGoで作る
Search
sasaki
October 24, 2019
Programming
0
210
コンテナをGoで作る
sasaki
October 24, 2019
Tweet
Share
More Decks by sasaki
See All by sasaki
Goを活用したサービス開発・運用の話
kuwabarakuwabara
1
1.6k
Other Decks in Programming
See All in Programming
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
subpath importsで始めるモック生活
10tera
0
300
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
イベント駆動で成長して委員会
happymana
1
320
Contemporary Test Cases
maaretp
0
140
Jakarta EE meets AI
ivargrimstad
0
560
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.4k
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.1k
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
427
64k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Code Reviewing Like a Champion
maltzj
520
39k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
The Invisible Side of Design
smashingmag
298
50k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Transcript
ίϯςφΛ(PͰ࡞Δ ࠤʑউय़ %FTJHO0OF(P
ࣗݾհ w ໊લɿࠤʑউय़ w ձࣾɿ߹ಉձࣾ%..DPN w ۀɿࣗࣾͷγεςϜΛ(PͰ։ൃͯ͠·͢ɻ·ͨɺΠϯ ϑϥ "84 ϑϩϯτ
3FBDU ͬͯ·͢ w ͖ͳͷɿམޠ ཱྲྀ ɺֆ
ࠓճ͓͢͠Δ͜ͱ (PͰίϯςφΛ࡞Δ
͜ͷςʔϚʹͨ͠ཧ༝ ίϯϐϡʔλαΠΤϯεΛࠓҰ͖ͪΜͱཧղ͔ͨͬͨͨ͠ Ί ۀͰίϯςφΛར༻ https://inside.dmm.com/entry/2019/03/28/review-go-test
ԾԽͱ w ϋʔυΣΞͱ04ͷؒʹͭͷ४04ΛೖΕΔ͜ͱͰҰ ͷϋʔυΣΞ্ʹෳͷ04γεςϜΛ҆શʹ͏ͨ Ίͷٕज़ 04Λಠཱͯ͠ѻ͏
ίϯςφͱ w ϗετͷ04ͷΧʔωϧΛڞ༗͍ͯͭͭ͠ɺΞϓϦέʔ γϣϯ͔Βݟͯಠཱͨ͠04Λ࣮ݱ͢Δٕज़
MJCDPOUBJOFSͰίϯςφ࡞ w %PDLFSͷίΞͱͯ͠(PͰॻ͔Ε͍ͯΔϥΠϒϥϦ IUUQTHJUIVCDPNPQFODPOUBJOFSTSVODUSFF NBTUFSMJCDPOUBJOFS
ίʔυৄࡉᶃ w ίϯςφͷੜͱJOUϓϩηεͷىಈͱ͍͏ͭͷ͜ͱΛ ͭͷϑΝΠϧͰ࣮ߦ͢ΔͨΊJOJU ؔΛఆٛ w ίϯςφΛ࡞͢ΔͨΊʹॳظԽͷઃఆ 4UBSU*OJUJBMJ[BUJPOͷύΠ ϓGEΛ։͘͜ͱͰΛίϯςφ Λϩʔυ
https://github.com/opencontainers/runc/blob/ master/libcontainer/factory_linux.go#L282
ίʔυৄࡉᶄ w ੜ͢Δίϯςφ ͷઃఆ /BNFTQBDFT $HSPVQTͳͲ ˞ߏମ$POpHͷ3PPUGϑΟʔϧυʹରͯ͠ɺίϯςφͰ৽͠ ͍ڥΛىಈ͢ΔͨΊʹඞཁͳϑΝΠϧγεςϜΛࢦఆ͢Δඞཁ ͕͋Γ·͢ɻ
ίϯςφϗετͷΧʔωϧΛڞ༗ͯ͠ར༻͢ΔͷͰσΟετϦ ϏϡʔγϣϯෆཁͰ͕͢ɺJOJUϓϩηεҎ߱ͷڥ͕ඞཁͳͨΊ Ͱ͢ɻࠓճEPDLFSJNBHFͷBMQJOFʹؚ·Ε͍ͯΔϑΝΠϧΛར ༻͠·ͨ͠
ίʔυৄࡉᶅ ίϯςφΛੜ IUUQTHJUIVCDPNPQFODPOUBJOFSTSVODCMPCNBTUFSMJCDPOUBJOFSGBDUPSZ@MJOVYHP- ॳظϓϩηεͱͯ͠CBTIΛੜ
ίϯςφʹϩάΠϯ ˞͜ͷϥΠϒϥϦ͕04YͰಈ͔ͤͳ͔ͬͨͷͰɺϩʔΧϧڥঢ়ʹ%PDLFSͰMJOVYίϯςφΛ্ཱͪ͛ͯɺ ͦͷதͰࣗ࡞ͷίϯςφΛੜ͢ΔΑ͏ʹ͍ͯ͠·͢ ຊసɻɻ ੜͨ͠ίϯςφʹϩάΠϯ
ֶͼ w HPΛͬͯίϯςφΛ࡞Δ͜ͱ͕Ͱ͖Δ͜ͱ͕͔ͬͨ w MJCDPOUBJOFSͷιʔεΛ͏͜ͱͰɺ04ϨϕϧͳͲΞϓ ϦέʔγϣϯϨΠϠʔΑΓԼͷॲཧΛͲͷΑ͏ʹ੍ޚͯ͠ ίϯςφΛੜ͠ɺ࣮ߦ͍ͯ͠Δ͔ΛֶͿ͜ͱ͕Ͱ͖ͨ https://golang.org/pkg/os/#Chown
ࢀߟࢿྉ w MJCDPOUBJOFS IUUQTHJUIVCDPNPQFODPOUBJOFSTSVODUSFFNBTUFSMJCDPOUBJOFS w 1PFLͱ(PMECFSHͷԾԽٕज़ IUUQTZVCFTTZIBUFOBCMPHDPNFOUSZ w %PDLFSͱ-9$ IUUQTRJJUBDPN4VSHPJUFNTBEDFBGCBE
w %PDLFS IUUQTXXXEPDLFSDPN w (PݴޠʹΑΔϓϩάϥϚʔࢹͷγεςϜϓϩάϥϛϯά(Pݴޠͱίϯςφ IUUQTBTDJJKQFMFN w ίϯςφϥϯλΠϜͷಈΛཧͯ͠Έͨ݅ IUUQTRJJUBDPNNBNPNBNPJUFNTFEECBCGB
͝੩ௌ͋Γ͕ͱ͏͟͝ ͍·ͨ͠