0
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?

CodeX CLI × Podman を WSL で動かす実践的セットアップ手順

Posted at

はじめに

本記事では、CodeX CLI を WSL 上の Ubuntu で利用し、Podman を用いてコンテナ動作検証を行う環境の構築手順をまとめます。

前提条件

  • Windows 11 + WSL2 環境が利用可能であること

  • WSL 側のディストリビューションは Ubuntu 22.04 以降 を推奨

  • CodeX CLI サンドボックスは full-access モード で起動すること

    • restricted モードでは Podman が利用できないため注意

手順

1. Podman のインストール

Ubuntu 環境に Podman をインストールします。

sudo apt update
sudo apt install -y podman uidmap crun runc podman-compose
  • uidmap: rootless 実行に必須
  • crun / runc: OCI runtime
  • podman-compose: Compose サポート

2. subuid / subgid の設定

rootless Podman 用にユーザ ID マッピングを設定します。

sudo sh -c "echo $USER:100000:65536 >> /etc/subuid"
sudo sh -c "echo $USER:100000:65536 >> /etc/subgid"

確認:

cat /etc/subuid /etc/subgid

3. systemd の有効化

/etc/wsl.conf を編集:

[boot]
systemd=true

[user]
default=devuser

WSL を再起動:

wsl --shutdown
wsl -d Ubuntu-22.04

ユーザ systemd を有効化:

sudo loginctl enable-linger $USER

4. Podman ソケットの有効化

ユーザサービスとして Podman ソケットを起動します。

systemctl --user enable --now podman.socket

動作確認

Podman が正しく動作するか確認します。

podman --version
podman info
podman run --rm -it alpine echo "hello from podman"

CodeX CLI でのテスト実行

CodeX CLI の Docker/Podman 連携テストを実行します。

make test-docker-unit
make test-docker-all

まとめ

  • full-access モードで起動することが必須条件
  • rootless Podman 実行に必要な設定は subuid/subgid、systemd、Podman ソケットの有効化
0
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
0
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?