関連記事

Cloud Native Buildpacksについてざっくり理解する

BackstageのDockerイメージをビルドしてみる




Lima とはどんなものなのか、どうやって使うのかざっくりまとめてみたいと思います。
Lima(Linux Machines)は、ファイル共有とポートフォワードを自動でやってくれる Linux 仮想マシンを構築してくれるツールです。
![]()
containerd を標準でサポートしており、そのほかのコンテナエンジン(Docker, Podman など)もサポートしています。
そのため、Lima で VM 構築して、その上でコンテナを起動するといったことができます。
インストールはbrewを使ってできます。
1brew install lima簡単な使い方を紹介します。
下記のコマンドで VM の起動ができます。--name=[instance name]でインスタンスの名前を設定できます。デフォルトの名前はdefaultです。
1limactl start実行すると、そのままの設定で起動するか、エディタを開いて設定を変更するか、テンプレートを選択するか聞かれますが、Proceed with the current configurationを選択するとそのままの設定で VM の起動が開始されます。
1❯ limactl start
2? Creating an instance "default" [Use arrows to move, type to filter]
3> Proceed with the current configuration
4 Open an editor to review or modify the current configuration
5 Choose another template (docker, podman, archlinux, fedora, ...)
6 Exitテンプレートを選択して、起動する場合は下記になります。
1limactl start template://[template name]1limactl start template://rocky-9テンプレートは下記から選択できます。
Templates
Quick usage To create and start a new instance from the template fedora: # Note: In Lima 1.x, template URLs included leading slashes, e.g. `template://fedora`. limactl create template:fedora limactl start fedora or limactl start template:fedora # For the second time onward, just run `limactl start fedora` To open a shell: limactl shell fedora or export LIMA_INSTANCE=fedora lima Template list ⭐ = “Tier 1” ☆ = “Tier 2” Default default (⭐Ubuntu, with containerd/nerdctl) Linux distributions almalinux-8: AlmaLinux 8 almalinux-9: AlmaLinux 9 almalinux-10, almalinux: AlmaLinux 10 experimental/almalinux-kitten-10, experimental/almalinux-kitten: AlmaLinux Kitten 10 alpine-3.21: Alpine Linux 3.21 alpine-3.22: Alpine Linux 3.22 alpine-3.23, alpine: ☆Alpine Linux 3.23 alpine-iso: ☆Alpine Linux (ISO9660 image). Compatible with the alpine template used in Lima prior to v1.0. archlinux: ☆Arch Linux centos-stream-9, centos-stream: CentOS Stream 9 centos-stream-10: CentOS Stream 10 debian-11: Debian GNU/Linux 11 (Bullseye) debian-12: Debian GNU/Linux 12 (Bookworm) debian-13, debian: ⭐Debian GNU/Linux 13 (Trixie) fedora-41: Fedora 41 fedora-42: Fedora 42 fedora-43, Fedora 43 fedora-44, fedora: ⭐Fedora 44 opensuse-leap-15: openSUSE Leap 15 opensuse-leap-16, opensuse-leap, opensuse: ⭐openSUSE Leap 16 oraclelinux-8: Oracle Linux 8 oraclelinux-9: Oracle Linux 9 oraclelinux-10, oraclelinux: Oracle Linux 10 rocky-8: Rocky Linux 8 rocky-9: Rocky Linux 9 rocky-10, rocky: Rocky Linux 10 ubuntu-20.04: Ubuntu 20.04 LTS (Focal Fossa) ubuntu-22.04: Ubuntu 22.04 LTS (Jammy Jellyfish) ubuntu-24.04: Ubuntu 24.04 LTS (Noble Numbat) ubuntu-24.10: Ubuntu 24.10 (Oracular Oriole) ubuntu-25.04: Ubuntu 25.04 (Plucky Puffin) ubuntu-25.10: Ubuntu 25.10 (Questing Quokka) ubuntu-26.04, ubuntu, ubuntu-lts: Ubuntu 26.04 (Resolute Raccoon) Same as default but comment lines are omitted from the YAML experimental/ubuntu-next: Ubuntu vNext experimental/gentoo: Gentoo experimental/opensuse-tumbleweed: openSUSE Tumbleweed experimental/debian-sid: Debian Sid experimental/fedora-rawhide: Fedora Rawhide Non-Linux NOTE: support for non-Linux OSes is experimental.
自分で設定ファイルを作成して、その設定から VM を起動することもできます。
1limactl start [yaml file]1limactl start my-vm.yaml設定ファイルの中身はdefaultの設定を参考に作成できます。
下記で VM の一覧が確認できます。
1limactl list1❯ limactl list
2NAME STATUS SSH VMTYPE ARCH CPUS MEMORY DISK DIR
3default Running 127.0.0.1:60022 qemu x86_64 4 4GiB 100GiB ~/.lima/default下記のコマンドで対象のインスタンスでコマンドを実行できます。
1limactl shell [instance] [command]また、下記で対象のインスタンスのシェルに接続できます。
1limactl shell [instance]limaコマンドもあり、下記 2 つのコマンドは同じものになります。
1lima
2limactl shell default下記の"Learning eBPF"のサンプルで用意されているlearning-ebpf.yamlを使って、VM を起動してみたいと思います。
learning-ebpf/learning-ebpf.yaml at main · lizrice/learning-ebpf
Learning eBPF, published by O'Reilly - out now! Here's where you'll find a VM config for the examples, and more - lizrice/learning-ebpf
まずは、設定ファイルを使って VM を起動します。
1❯ limactl start learning-ebpf.yaml
2? Creating an instance "learning-ebpf" [Use arrows to move, type to filter]
3> Proceed with the current configuration
4 Open an editor to review or modify the current configuration
5 Choose another template (docker, podman, archlinux, fedora, ...)
6 Exit起動が完了して、limactl listを実行すると起動しているのが確認できます。
1❯ limactl list
2NAME STATUS SSH VMTYPE ARCH CPUS MEMORY DISK DIR
3learning-ebpf Running 127.0.0.1:58090 qemu x86_64 4 10GiB 100GiB ~/.lima/learning-ebpfシェルに接続してみます。
1❯ limactl shell learning-ebpf
2masa@lima-learning-ebpf:/Users/masa$lsとかを実行すると、ホストマシンのファイルが確認でき、ファイル共有ができていることがわかります。また、ホームディレクトリは VM のユーザーのホームディレクトリになっていることがわかります。
1masa@lima-learning-ebpf:/Users/masa$ echo $HOME
2/home/masa.linuxVM の停止と削除は下記のコマンドでできます。
1limactl stop learning-ebpf1limactl delete learning-ebpf