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
僕とHaconiwa /haconiwa-intro
Search
KONDO Uchio
August 29, 2016
Technology
1
1.4k
僕とHaconiwa /haconiwa-intro
KIXS #0 LT 大会にて
https://kixs.doorkeeper.jp/events/49820
KONDO Uchio
August 29, 2016
Tweet
Share
More Decks by KONDO Uchio
See All by KONDO Uchio
大規模レガシーテストを 倒すための CI基盤の作り方 / #CICD2023
udzura
5
2.3k
Ruby x BPF in Action / RubyKaigi 2022
udzura
0
190
Narrative of Ruby & Rust
udzura
0
170
開発者生産性指標の可視化 / pepabo-four-keys
udzura
3
1.6k
Talk of RBS
udzura
0
390
Re: みなさん最近どうですか? / FGN tech meetup in 2021
udzura
0
710
Dockerとやわらかい仮想化 - ProSec-IT/SECKUN 2021 edition -
udzura
2
670
Device access filtering in cgroup v2
udzura
1
770
"Story of Rucy" on RubyKaigi takeout 2021
udzura
0
720
Other Decks in Technology
See All in Technology
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
430
スクラム成熟度セルフチェックツールを作って得た学びとその活用法
coincheck_recruit
1
140
信頼性に挑む中で拡張できる・得られる1人のスキルセットとは?
ken5scal
2
530
初心者向けAWS Securityの勉強会mini Security-JAWSを9ヶ月ぐらい実施してきての近況
cmusudakeisuke
0
120
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
870
SSMRunbook作成の勘所_20241120
koichiotomo
2
130
強いチームと開発生産性
onk
PRO
34
11k
ドメイン名の終活について - JPAAWG 7th -
mikit
33
20k
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.4k
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
470
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Producing Creativity
orderedlist
PRO
341
39k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Faster Mobile Websites
deanohume
305
30k
Visualization
eitanlees
145
15k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Making Projects Easy
brettharned
115
5.9k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Transcript
͋Δ͍ԼܥΠϯσΟʔόϯυγʔϯʹ͍ͭͯ 6DIJP,POEP ,*94 ͱ)BDPOJXB GSPNIUUQTIPXDBTFDJUZGVLVPLBMHKQBMMSJHIUTSFTFSWFE
ΤϯδχΞ݉ਓؒ 6DIJP,POEP!VE[VSB (.0ϖύϘٕज़ج൫νʔϜ
!VE[VSBͷਓؒྺ ΄Ͳ3VCZਥͱͯ͠ΞοϓϦέʔγϣ ϯΤϯδχΞΛܦݧ͠ɺۀγεςϜɺ &$αΠτɺΦϯϥΠϯήʔϜͳͲΛ ܦͯϖύϘɻͦΕͱҰॹʹౚژ͔Β ԬʹҠॅ͢Δɻ ϖύϘͰྲྀΕͰ1VQQFUΛओʹ৮Δ ۀʹैࣄ͍͕ͯͨ͠ɺ࠷ۙ$ݴޠ ͱNSVCZͰγεςϜϓϩάϥϛϯάॳ ৺ऀͱͯ͠ؤு͍ͬͯΔɻ
͖ͳϙέϞϯൃੜҬඦಓɻ
ΞϨͰ͢CZ=
)BDPOJXBͱ
)BDPOJXBͱ wίϯςφΤϯδϯ w࠷େͷಛɺ3VCZ NSVCZ Ͱίϯςφͷઃఆ͕ࣗ༝ࣗࡏʹॻ͚Δ͜ͱ w%PDLFSΛଧ͠ͳ͍͚Ͳɺ%PDLFSͰϠϦͮΒͦ͏ͳ͜ͱͰ͖Δ͔ʁ
ίϯςφΤϯδϯͱ wίϯςφΈ߹Θͤɻ w۩ମతʹɺ-JOVYOBNFTQBDFɺDHSPVQɺ-JOVYDBQBCJMJUJFTɺ DISPPUɺCJOENPVOUɺͳΜ͔ΛΈ߹ΘͤͯɺϓϩηεʢͷҰ܈ʣΛ ͔͋ͨԾڥͷΑ͏ʹݟͤͯ׆༻͢Δٕज़ w)BDPOJXBɺ͜ͷؔ࿈ٕज़Λૢ࡞͢ΔNSVCZHFNΛͻͨ͢Β࡞Γ·͘Γɺ Έ߹ΘͤͯɺίϯςφڥΛ࣮ݱ͍ͯ͠·͢ɻ
໊લͷ༝དྷ w·Μ·ʮശఉʯͳΜ͚ͩͲɺ͘ͳΓ·ͯ͠ wͱͱɺຊͰҰ൪༗໊ͳKBJMͰ͋Δʮ"CBTIJSJʯͱ͍͏໊લΛ͚ͭΑ͏ͱ wࢥ͚ͬͨͲɺઑΓ͔͗͢ͳͬͯࢥ͍͠
໊લͷ w࣍ʹࢥ͍͍ͭͨͷ͕ɺԼͰΠϯσΟʔόϯυͱͯ͠׆༂͍ͯͨ͠ʢࠓͨ ·ʹϥΠϒΛ͍ͯ͠Δʣʮശఉͷָࣨʯͱ͍͏ɺۂ͕جຊతʹมഥࢠͷɺι ϑτϚγʔϯͱϖΠϰϝϯτΛͯ͠ແཧͰׂͬͨΑ͏ͳόϯυ͕͋Γɺ wʢҎԼ͙Β͍ɺθϩͷԼΠϯσΟʔζϩοΫͷΛ͢Δʣ
ͱ͜ΖͰɺʹɺϓϩάϥϚͱͯ͠ເ͕͋ͬͨ wҰͰ͍͍͔Βɺࣗͷ͖ͳόϯυ͋Δ͍ۂͷ໊લͷ͍ͨ w044ϓϩμΫτΛ wੈʹग़͔ͨͬͨ͠ wग़͔ͨͬͨ͠Μͩʂ
ͬͨ
ࠓͷ·ͱΊເ͏
ؓ ٳ GSPNIUUQTIPXDBTFDJUZGVLVPLBMHKQBMMSJHIUTSFTFSWFE
)BDPOJXBΛͰࢼ͢
͜ͷઌɺ3VCZ,BJHJ͚ͷࢿྉΛ ྲྀ༻͍ͤͯͩ͘͞͞ɻɻɻɻɻɻ
͔ͩΒϑΥϯτมΘΓ·͢ʂʂ̍
Πϯετʔϧ w QBDLBHFDMPVE͔Βམͱͤ·͢ɻ؆୯Ͱ͢Ͷʂ IUUQTQBDLBHFDMPVEJPVE[VSBIBDPOJXBJOTUBMM # example for deb-ish distro curl
-s https://packagecloud.io/install/repositories/udzura/ haconiwa/script.deb.sh | sudo bash apt-get update apt-get install haconiwa apt-get install lxc # It’s required to bootstrap fs
࠷ॳʹઃఆϑΝΠϧΛੜ͠·͢ $ haconiwa new test.haco assign new haconiwa name =
haconiwa-0491a405 assign rootfs location = /var/lib/haconiwa/0491a405 create test.haco
͜ͷઃఆϑΝΠϧ࣮ࡍͨͩͷ3VCZεΫϦϓτͰ͢
lIBDPOJXBDSFBUFzͰϑΝΠϧγεςϜΛ࡞Γ·͢ w ੜ͞Εͨ··ͩͱBMQJOFMJOVY͕MYDDSFBUFͰ࡞ΒΕ·͢
TTIEΛΠϯετʔϧͯ͠ةݥͳઃఆΛ͠·͢ Haconiwa.define do |config| #... config.provision do |p| p.run_shell <<-SHELL
apk add --update openssh sed -i 's/#Port.*/Port 2222/' /etc/ssh/sshd_config # NOTE: αϯϓϧ͔ͩΒͶʂ sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config sed -i 's/#PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config echo root:r00t | chpasswd ssh-keygen -t rsa -P "" -f /etc/ssh/ssh_host_rsa_key SHELL end #... end
lIBDPOJXBQSPWJTJPOzͰ͏ҰϓϩϏδϣχϯά
lJOJUzίϚϯυΛTTIEʹม͑ͯɺσʔϞϯԽ͠·͢ Haconiwa.define do |config| # The container name and container's
hostname: config.name = "haconiwa-0491a405" # The first process when invoking haconiwa run: # config.init_command = "/bin/bash" # To: config.init_command = %w(/usr/sbin/sshd -D) # And uncomment: config.daemonize! #... end $ haconiwa run test.haco
None
ຬͨ͠ΒɺlIBDPOJXBLJMMzͰ͚ͬͭ·͢ $ haconiwa kill test.haco Kill success
Ҏ্ʂ
ׂͱͪΌΜͱίϯςφͰ͖ͯͳ͍ʁ
͍͚Δͬͯʂ
ྫ͑͜͏͍͏࣌ʢ༧ఆʣ wϗετͱ৭ʑͳOBNFTQBDFΛڞ༗ͨ͠ڥΛ࡞Γ͍ͨ wੜ࣌ʹɺಈతʹDHSPVQͷύϥϝʔλΛม͍͑ͨ wͳΜ͔ෳࡶͳCJOENPVOUΛܦͯSPPUGTΛ࡞Γ͍ͨ w%̋DLFSΑΓܰΊʹϚΠΫϩαʔϏοε͍ͨ͠ͳʙʙʙ͋ʙʙʙʙ wͳͲͳͲ wকདྷతʹɺΦʔέετϨʔγϣϯαϙʔτ͍ͨ͠ɺͰ͖Δͱ͍͍Ͱ͢Ͷ
ͪͳΈʹ wFUDE qBOOFMͱΈ߹ΘͤͯΦʔόϨΠωοτϫʔΫͳΜ͔ wOFUOTࣗ࡞͍ͯͩ͘͠͞ʢͦΕΛIBDPOJXB࠶ར༻Ͱ͖·͢ʣ
˞ࠓճಈ͖·ͤΜ
৬ਓͷ࡞ΔOFUOT͔Β QJOHΛଧͭͱɺ ύέοτʹஆ͔Έ͕͋Δ
ӕͰ͍ۙ͢͏ͪʹ )BDPOJXBʹΈࠐΈ·͢ ͳΜ͔ܰͯ͘ૄ݁߹ͳΓํΛߟ͍͑ͨͰ͢Ͷ
·ͱΊ·͢
ࠓͷ·ͱΊ w)BDPOJXBԼܥมഥࢠίϯςφͰ͢ w)BDPOJXBͷৄࡉΛΓ͍ͨํɺͥͻ࠶དྷिͷ3VCZ,BJHJʂ wژͰѲखʂ
None
)BDPOJXBJTVOEFSEFWFMPQNFOU Ͱ͕͢ɺ༡ΜͰΈͯͶ