[英]Getting runc config.json from docker container
I am trying to create a runc container from a docker container.我正在尝试从 docker 容器创建一个 runc 容器。
I followed this blog post and was successfull in extracting the config.json from the running docker container.我关注了这篇博客文章,并成功地从正在运行的 docker 容器中提取了 config.json。
The issue is that问题是
I have conflicting information on where to find the config.json, and am unable to find it on my host.我有关于在哪里可以找到 config.json 的冲突信息,并且无法在我的主机上找到它。
|config.json location | source |
|-----------------------------------------|--------------------------------------------|
|/run/docker/libcontainerd/<container id> | http://crunchtools.com/getting-ninja-runc/ |
|/var/run/docker/libcontainerd/<container id> |https://github.com/genuinetools/riddler |
|/var/run/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/<container id> | my host #1 |
| ??? | my host #2 |
What other locations can I check, and how can I tell which one it will be?我还可以检查哪些其他位置,以及如何确定它将是哪个位置? Is this configured somewhere, does this depend on the version of docker, containerd, runc, or something else?
这是在某处配置的,这是否取决于 docker、containerd、runc 或其他版本?
I found config.json here:我在这里找到了 config.json:
/run/containerd/io.containerd.runtime.v1.linux/moby/container_id/config.json
on ubuntu18.04, docker version:在 ubuntu18.04 上,docker 版本:
Client: Docker Engine - Community
Version: 19.03.4
API version: 1.40
Go version: go1.12.10
Git commit: 9013bf583a
Built: Fri Oct 18 15:54:09 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.4
API version: 1.40 (minimum version 1.12)
Go version: go1.12.10
Git commit: 9013bf583a
Built: Fri Oct 18 15:52:40 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.10
GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version: 1.0.0-rc8+dev
GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
docker-init:
Version: 0.18.0
GitCommit: fec3683
@lin.qian 's answer saves me hours. @lin.qian 的回答为我节省了几个小时。 config.json is now located in
/run/containerd/io.containerd.runtime.v1.linux/moby/
rather than all the other locations mentioned in the question post. config.json 现在位于
/run/containerd/io.containerd.runtime.v1.linux/moby/
而不是问题帖子中提到的所有其他位置。
Actually if you further want to use this config file with runc, you need modify实际上,如果您还想将此配置文件与 runc 一起使用,则需要修改
and remove the following from "mounts"并从“坐骑”中删除以下内容
and remove "hooks"并删除“钩子”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.