【问题标题】:change the docker runtime version更改 docker 运行时版本
【发布时间】:2021-04-07 10:58:16
【问题描述】:

tl;dr 使用dockerd,如何选择v2 运行时?

docker run 警告建议 v2 运行时

docker 无法运行 docker run hello-worldonly 警告是 consider using runtime v2 在文件 /var/log/deamon.log

中找到
containerd[367]: level=warning msg="runtime v1 is deprecated since containerd v1.4, consider using runtime v2" time="2020-12-30T15:49:25.426984959-08:00"

这是所有系统日志和--debug 输出中唯一的警告或错误,所以这是我最好的下一步。

runtimedockerd --help 选项是

‣ dockerd --help | grep runtime
      --add-runtime runtime      Register an additional OCI compatible runtime (default [])
      --cpu-rt-runtime int       Limit the CPU real-time runtime in microseconds
      --default-runtime string   Default OCI runtime for containers (default "runc")

正在使用的版本

在 Raspberry Pi 2 上运行 Raspbian 9 (Debian 9)。

使用docker-ce安装(使用get-docker.sh安装)

‣ dpkg --status docker-ce
Package: docker-ce
Status: install ok installed
Priority: optional
Section: admin
Installed-Size: 68106
Architecture: armhf
Version: 5:19.03.14~3-0~raspbian-stretch
Replaces: docker-engine
Depends: docker-ce-cli, containerd.io (>= 1.2.2-3), iptables, libseccomp2 (>= 2.3.0), libc6 (>= 2.4), libdevmapper1.02.1 (>= 2:1.02.97), libsystemd0
Recommends: ca-certificates, cgroupfs-mount | cgroup-lite, git, pigz, xz-utils, libltdl7
Conflicts: docker (<< 1.5~), docker-engine, docker-engine-cs, docker.io, lxc-docker, lxc-docker-virtual-package
...

dockerd

‣ dockerd --version
Docker version 19.03.14, build 5eb3275d40

【问题讨论】:

    标签: docker raspberry-pi debian raspbian raspbian-stretch


    【解决方案1】:

    Docker 版本 19.03 不允许您选择 v2 运行时。

    只有 Docker 20.10.0 引入了 runtime v2 并将其用作默认运行时。 有关更多详细信息,请参阅 Docker 发行说明https://docs.docker.com/engine/release-notes/#runtime-5

    将 runtime v2 引入 Docker 20.10.0 的详细信息表明,您应该可以通过指定 --default-runtime=com.docker.runtime.runc.v1 来主动选择 Docker 20.10.0 以上的默认运行时,请参阅https://github.com/moby/moby/pull/41182

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-09-04
      • 1970-01-01
      • 1970-01-01
      • 2020-11-07
      • 2020-05-23
      • 2021-10-19
      • 2011-03-20
      相关资源
      最近更新 更多