Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Packer で自分だけの Raspberry Pi イメージを 作った話 / #techst...
Search
さたけ
May 14, 2020
Technology
440
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Packer で自分だけの Raspberry Pi イメージを 作った話 / #techstudygroupjp 2020.5.14
さたけ
May 14, 2020
More Decks by さたけ
See All by さたけ
GitHubとCircleCIで過去問管理 / #aosc 2019-12-21
satackey
0
82
Dockerを使ってみよう / #kosenconf131hokkaido
satackey
0
200
Cloud Foundry を使ってみた / #aosc 2018-02-23
satackey
0
40
Other Decks in Technology
See All in Technology
Claude Code本は、どのように執筆チームで書かれたか
oikon48
1
380
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
150
Local CI × GitHub Actions
gogutan
2
190
大型犬好きによるPugの紹介
yamanoku
1
160
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
940
Browser Spec: Testing Hotwire with Ruby
takahashim
1
120
WasmをRustにする
sansantech
PRO
0
250
アウトプット初心者、半年間のふりかえり
4o1sobblue
0
430
オントロジーって 結局なにもの? AI エージェントに「意味」を渡す知識設計の話
greenmidori
0
200
継続的なAIコスト最適化
bgpat
1
340
[JAWS-UG彩の国埼玉#12]そろそろ準備する?re:Invent2026をやさしく解説 / reinvent2026-sainokuni
sh_fk2
1
340
『SAR衛星データ解析入門』のご紹介とその応用
syuchimu
0
120
Featured
See All Featured
How to Ace a Technical Interview
jacobian
280
24k
Utilizing Notion as your number one productivity tool
mfonobong
4
620
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
550
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
480
First, design no harm
axbom
PRO
2
1.3k
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
Ruling the World: When Life Gets Gamed
codingconduct
0
400
A Modern Web Designer's Workflow
chriscoyier
699
190k
Code Review Best Practice
trishagee
74
20k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Transcript
PackerͰ͚ࣗͩͷ Raspberry PiΠϝʔδΛ ࡞ͬͨ ͚ͨ͞ #techstudygroupjp 2020.5.14
ࣗݾհ • খߴઐ 3 ใܥ ࠤ ߤر • WebϑϩϯτɾόοΫΤϯυ ΠϯϑϥͳͲ͍Ζ͍Ζ…
@satakenkoki ࡳຈ খ
Raspberry Pi • ͍҆: ຊମ5000ԁ͙Β͍ • ిؾ͍҆: 24࣌ؒىಈͯ͠ɺඦԁ /
݄ ࣗαʔόʹ࠷ద!!
Raspberry Pi • SDΧʔυʹOSΛॻ͖ࠐΉ • ΠϯετʔϥΛΘͳͯ͘OK microSDΧʔυ
RasPiͷΠϝʔδΛ࡞Δํ๏ 1 • ҰRaspberry PiΛىಈͯ͠ɺڥߏங • SDΧʔυΛΠϝʔδͱͯ͠PCʹอଘ͢Δ • όοΫΞοϓͱಉ͡!!
RasPiͷΠϝʔδΛ࡞Δํ๏ 2 • Raspberry Pi ͷΤϛϡϨʔλΛPC্Ͱɺ ىಈɺڥߏஙɻ • ΤϛϡϨʔλΛγϟοτμϯ͢Ε Πϝʔδͷ
ΰʔϧσϯΠϝʔδ • ΫϥυΛ͏ͱ͖ʹΑ͘ΘΕΔΓํ • ࣄલʹڥߏஙΛߦͬͨΠϝʔδΛ࡞Δ • ڥߏஙΛऴΘΒͤͨΠϝʔδ͔Β ԾϚγϯΛىಈ͢Δ
ڥߏஙͷޙɺʮӡ༻ʯ͕͋Δ • ී௨ͷαʔόͷӡ༻Ͱ ΞοϓσʔτͳͲͷมߋΛՃ͍͑ͯ͘ • ʮ࠷ॳͷߏங͕ࡁΊऴΘΓʯͰͳ͍
ڥߏஙͷޙɺʮӡ༻ʯ͕͋Δ • ී௨ͷαʔόͷӡ༻Ͱ ΞοϓσʔτͳͲͷมߋΛՃ͍͑ͯ͘ • ʮ࠷ॳͷߏங͕ࡁΊऴΘΓʯͰͳ͍ • هΛ͓͔ͯ͠ͳ͍ͱɺ ࠓͷঢ়ଶ͕Θ͔Βͳ͘ͳͬͯ͠·͏ ࣗͻͱΓ͚ͩͳΒ·ͣϝϞ͢Δ͜ͱͳ͍
ڥߏஙͷޙɺʮӡ༻ʯ͕͋Δ • खݩͷ։ൃڥͰಈ͚͘Ͳɺ αʔόͰͷಈ࡞͕͓͔͍͠ͱ͔…… • ڥΛ࠶ݱ͢Δͱ͖ɺهΛཔΓʹ ਓͷखͰ࡞ۀ͠ͳ͍ͱ͍͚ͳ͍
Immutable Infrastructure • ΰʔϧσϯΠϝʔδͷൃలܗ • ҰΠϝʔδΛ࡞ͬͨΒɺ αʔόʹखΛՃ͑ͳ͍ͱ͍͏ϙϦγʔ • ߋ৽͕ඞཁͳΒҰ͔Β࡞Γ͢
Ұ͔Β࡞Δ ΊΜͲ͍͘͞ͷͰ
Ұ͔Β࡞Δ ΊΜͲ͍͘͞ͷͰ
ࣗಈԽ͠Α͏ Infrastructure as Code ͱݴͬͨΓ͠·͢
ࣗಈԽ͠Α͏ Infrastructure as Code ͱݴͬͨΓ͠·͢
None
Packer • Πϝʔδ࡞ͷࣗಈԽπʔϧ • ެࣜͰɺAWSVirtualBoxͷ Πϝʔδͷ࡞ʹରԠ͍ͯ͠Δ • ͦΕͧΕϓϥάΠϯͱ࣮ͯ͠͞Ε͍ͯΔ • Raspberry
PiʹରԠͨ͠ϓϥάΠϯ͕ɺ GitHub ʹެ։͞Ε͍ͯΔ
solo-io/packer-builder-arm-image • ArmΠϝʔδΛ࡞ΔͨΊͷ PackerϓϥάΠϯ • QEMUΛͬͯArmͷԾڥΛ࡞͍ͬͯΔ
PackerͰΠϝʔδΛ࡞Δʹ? • PackerΛΠϯετʔϧ͢Δ • packer-builder-arm-image ͱ ͦͷґଘύοέʔδΛΠϯετʔϧ (Docker
Vagrant ͰͰ͖Δ) • JSONΛॻ͘ʂ
JSONͷॻ͘ { "builders": [ { "type": "arm-image", "iso_url" : "file:///build/2020-02-13-raspbian-buster-lite.zip",
"iso_checksum_type":"sha256", "iso_checksum": "12ae6e17bf95b6ba83beca61e7394e7411b45eba7e6a520f434b0748ea7370e8", "target_image_size": 4294967296 } ], "provisioners": [ { "type": "shell", "inline": [ "systemctl enable ssh”, "mkdir /home/pi/.ssh && chmod 644 /home/pi/.ssh", "curl -o /home/pi/.ssh/authorized_keys https://github.com/satackey.keys” ] } ] } ԿͷΠϝʔδΛ ࡞Δͷ͔(builder) ԿΛ࣮ߦ͢Δͷ͔ (provisioner)
JSONͷॻ͘ { "builders": [ { "type": "arm-image", "iso_url" : "file:///build/2020-02-13-raspbian-buster-lite.zip",
"iso_checksum_type":"sha256", "iso_checksum": "12ae6e17bf95b6ba83beca61e7394e7411b45eba7e6a520f434b0748ea7370e8", "target_image_size": 4294967296 } ], "provisioners": [ { "type": "shell", "inline": [ "systemctl enable ssh”, "mkdir /home/pi/.ssh && chmod 644 /home/pi/.ssh", "curl -o /home/pi/.ssh/authorized_keys https://github.com/satackey.keys” ] } ] } ϕʔεʹͳΔΠϝʔδͷ ύεΛࢦఆʢURLOKʣ
JSONͷॻ͘ { "builders": [ { "type": "arm-image", "iso_url" : "file:///build/2020-02-13-raspbian-buster-lite.zip",
"iso_checksum_type":"sha256", "iso_checksum": "12ae6e17bf95b6ba83beca61e7394e7411b45eba7e6a520f434b0748ea7370e8", "target_image_size": 4294967296 } ], "provisioners": [ { "type": "shell", "inline": [ "systemctl enable ssh", "mkdir /home/pi/.ssh && chmod 644 /home/pi/.ssh", "curl -o /home/pi/.ssh/authorized_keys https://github.com/satackey.keys" ] } ] } SSH Λ༗ޮԽ ࣗͷSSHެ։伴Λ GitHub͔Βμϯϩʔυ
ΠϝʔδΛ࡞Δ $ packer build ssh_key.json output-arm-image ʹ Πϝʔδ͕Ͱ͖͍ͯΔ ͜ΕΛSDΧʔυʹॻ͖ࠐΜͰʂ
Provisioner • ྫ Shell Λಈ͔͢ͷͰ͕ͨ͠ɺ ͦͷ΄͔ʹ͜Μͳ͜ͱͰ͖·͢ʂ • ϑΝΠϧͷίϐʔ • JSONॻ͖ΛͤͣγΣϧεΫϦϓτΛ࣮ߦ
• AnsibleͳͲΛ࣮ߦ
PackerͰ͚ࣗͩͷ Raspberry PiΠϝʔδΛ ࡞ͬͨ ͚ͨ͞ #techstudygroupjp 2020.5.14
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠!