wsl2 podman run 啟動容器錯誤


wsl2中安裝podman,啟動容器報錯

包含3個錯誤:

OCI runtime error: systemd is not available,unable to write pod event, CNI network "podman" not found

具體如下:

podman run --rm -it docker.io/alpine ash
ERRO[0000] unable to write pod event: "write unixgram @00039->/run/systemd/journal/socket: sendmsg: no such file or directory"
ERRO[0000] CNI network "podman" not found
Error: error configuring network namespace for container 686aa0ac15508ae265fee439f61e2fdb960ef5a7fb61d51a7818fbf78796261a: CNI network "podman" not found
Error: OCI runtime error: systemd cgroup flag passed, but systemd support for managing cgroups is not available

解決辦法

添加參數:--cgroup-manager=cgroupfs, --events-backend=file ,--net=host

例子:

podman --cgroup-manager=cgroupfs --events-backend=file run --net=host --rm -it docker.io/alpine ash

也可以設置containers.conf
vi /etc/containers/containers.conf

[engine]
events_logger="file"
cgroup_manager="cgroupfs"

啟動時就可以少加--cgroup-manager=cgroupfs--events-backend=file`這兩個參數

參考: https://github.com/containers/podman/issues/4325


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM