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
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
Amazon Qを使ってIaCを触ろう!
maruto
0
410
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
230
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
flutterkaigi_2024.pdf
kyoheig3
0
130
受け取る人から提供する人になるということ
little_rubyist
0
230
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
CSC509 Lecture 12
javiergs
PRO
0
160
ヤプリ新卒SREの オンボーディング
masaki12
0
130
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
How to Ace a Technical Interview
jacobian
276
23k
The World Runs on Bad Software
bkeepers
PRO
65
11k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Agile that works and the tools we love
rasmusluckow
327
21k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Navigating Team Friction
lara
183
14k
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
͝੩ௌ͋Γ͕ͱ͏͟͝ ͍·ͨ͠