📝

Podmanメモ

2022/04/13に公開

初期設定

$ brew install podman
$ podman --version
podman version 4.0.3
$ podman machine init

zshでコマンドを補完する

$ echo 'fpath=(/opt/homebrew/share/zsh/site-functions $fpath)' >> .zshrc
$ exec $SHELL -l
$ podman machine [tab]
init   -- Initialize a virtual machine
list   -- List machines
rm     -- Remove an existing machine
set    -- Sets a virtual machine setting
ssh    -- SSH into an existing machine
start  -- Start an existing machine
stop   -- Stop an existing machine

VM を起動する

$ podman machine start
Starting machine "podman-machine-default"
INFO[0000] waiting for clients...
....
Machine "podman-machine-default" started successfully

podman-composeも使ってみる

$ pip3 install podman-compose
$ sudo /opt/homebrew/Cellar/podman/4.0.3/bin/podman-mac-helper install
$ podman machine stop; podman machine start

docker-compose.ymlが存在するdirで起動してみる

$ cd path/to/docker-compose
$ podman-compose up -d

Discussion