はじめに
最近話題に上がっている Podman Desktop
を使ってみたかったので、プライベートではこちらを使ってみることにする。
環境
Windows 11 Professional
Podman Desktop v1.15.0
Podman Desktopのインストール
サイトにアクセスをする
Latest Stable Podman Desktop <バージョン>のリンクをクリックする

Click here to download itからダウンロードをする

今回はWindowsのなのでWindows版を選択する

インストーラーを起動する
インストーラーを起動したら、特に何も聞かれずにすぐにインストールできた!

Go to podman Desktop
を選択する
後で設定できるみたいなので今回は一旦スキップする
podmanのインストール
先ほど設定をスキップした podman
をインストールしておこう。
DashboardからPodmanの「Install」を選択する

インストール完了後「Yes」を選択する


Setupで「WSL2」を選択する

「Initialize & Start」を選択する

runningになればOK

コンテナを起動してみる
まずは、コマンドプロンプトを起動してpodman ps
を実行する
podman ps
Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM
Error: unable to connect to Podman socket: open C:\Users\xxxxx\.ssh\known_hosts: The system cannot find the path specified.
起動していないようなので、
podman machine init
podman machine start
を実行する。
podman machine init
Error: podman-machine-default: VM already exists
podman machine start
Starting machine "podman-machine-default"
Error: machine podman-machine-default: VM already running or starting
起動しとるやないかい!
下記のissueを見てみると、
https://github.com/containers/podman/issues/24616
C:\Users\xxxxx\.ssh\known_hosts
のファイルがないからこうなっているみたい。
というわけで、指定のディレクトリを作成しておく。
mkdir -p C:\Users\xxxxx\.ssh\
この後、podman ps
を実行する。
podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
できた!
テスト用のコンテナを起動する
podman run quay.io/podman/hello
podman run quay.io/podman/hello
Trying to pull quay.io/podman/hello:latest...
Getting image source signatures
Copying blob sha256:81df7ff16254ed9756e27c8de9ceb02a9568228fccadbf080f41cc5eb5118a44
Copying config sha256:5dd467fce50b56951185da365b5feee75409968cbab5767b9b59e325fb2ecbc0
Writing manifest to image destination
!... Hello Podman World ...!
.--"--.
/ - - \
/ (O) (O) \
~~~| -=(,Y,)=- |
.---. /` \ |~~
~/ o o \~~~~.----. ~~
| =(X)= |~ / (O (O) \
~~~~~~~ ~| =(Y_)=- |
~~~~ ~~~| U |~~
Project: https://github.com/containers/podman
Website: https://podman.io
Desktop: https://podman-desktop.io
Documents: https://docs.podman.io
YouTube: https://youtube.com/@Podman
X/Twitter: @Podman_io
Mastodon: @Podman_io@fosstodon.org
Hello Podman Worldという文字と、やる夫みたいなキャラがでてきたらOK!
Dockerプロジェクトでpodmanコマンドを使ってみる
以前作成した、PostgreSQLのDockerプロジェクトをクローンする。 https://github.com/katsuobushiFPGA/postgresql-procedure-dev
git clone https://github.com/katsuobushiFPGA/postgresql-procedure-dev.git
cd .\postgresql-procedure-dev\
podman compose up -d
起動できた!
[+] Running 3/3
✔ Network postgresql-procedure-dev_default Created 0.0s
✔ Volume "postgresql-procedure-dev_db-data" Created 0.0s
✔ Container postgresql-procedure-dev-db-1 Started 0.2s
podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
083a3db0a349 docker.io/library/postgresql-procedure-dev-db:latest postgres -c confi... About a minute ago Up About a minute 0.0.0.0:5432->5432/tcp postgresql-procedure-dev-db-1
PgAdminでPostgreSQLにアクセスできることを確認。
参考
Podman Desktop を使ってみる
https://zenn.dev/robon/articles/676736b9468719Podman Desktopインストール手順<Windows向け>
https://sukkiri.jp/technologies/virtualizers/podman-desktop-install-windows-html.htmlMissing known_hosts file in Windows prevents connection as of 5.3.0
https://github.com/containers/podman/issues/24616
おわりに
.devcontainer
とかの資産を使いたいので次回以降はこのあたり調べてみる。