1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Firecrackerをarchlinuxで入門

Posted at

Firecracker 入門

今回はfirecrackerをarchlinuxで触っていきます。
この記事では起動できるところまで紹介します。
firecrackerとはなんぞ?という人は公式ページをご参照ください。

前提条件

  • x86_64
  • archlinux
  • kvmが有効

1. Install yay (通常ユーザーで実行)

archlinuxにはコミュニティパッケージをインストールできるyayがあります。
今回はyayを使って簡単に導入していきます。

cd ~
# アプデ
sudo pacman -Syy
# yayの必須パッケージ
sudo pacman -S --noconfirm git fakeroot binutils make gcc go
# yayのソースをクローン
git clone https://aur.archlinux.org/yay.git
cd yay
# ビルドして/usr/binにぶち込む (知らんけど
makepkg -si --noconfirm
cd ..
# 残りカスを抹消
rm -rf yay

2. Install firecracker & firectl

なんとこれだけで全部入ります。

yay -Sy firectl

3. Download kernel and rootfs

firecrackerはカーネルを軽量化して起動を爆速にしてるのでkernelrootfsを別々で持ってくる必要があります。
補足:cgroupv2が採用されているdocker環境でfirecrackerを使う際はkernelのバージョンが5.10以上である必要があるため、下記のvmlinux.binは使えません。

curl -sLo vmlinux.bin https://s3.amazonaws.com/spec.ccfc.min/img/quickstart_guide/x86_64/kernels/vmlinux.bin
curl -sLo rootfs.ext4 https://s3.amazonaws.com/spec.ccfc.min/img/quickstart_guide/x86_64/rootfs/bionic.rootfs.ext4

4. Boot !!!

もうこれで最後です。
kernelとrootfsのファイルを指定するだけで起動してくれます。
今回使うrootfsはrootで自動loginしてくれます。

firectl \
  --kernel=vmlinux.bin \
  --root-drive=rootfs.ext4

以上!

感想 (?)

今回は簡単に導入して使ってみよう的なノリの入門でした。
firecrackerは技術的にもかなりすごいものなので、kubernetesとかで使えるようになってくれるといいですね、(期待!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?