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

wsl2 podman run 启动容器错误

也可以设置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

相关文章:

  • 2021-05-21
  • 2022-02-05
  • 2021-11-04
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-14
  • 2022-01-07
  • 2021-07-29
  • 2021-06-15
  • 2021-05-30
相关资源
相似解决方案