从Docker容器获取Runc config.json [英] Getting runc config.json from docker container
问题描述
我正在尝试从docker容器创建一个runc容器.
I am trying to create a runc container from a docker container.
我关注了此博客文章,并成功地从运行docker容器.
I followed this blog post and was successfull in extracting the config.json from the running docker container.
问题是
- 我找到config.json的路径与我在网上找到的引用不同
- 据我所知,同一路径在具有相同docker版本的其他主机上不起作用.在该主机上,我无法找到config.json的生成位置.
关于在哪里可以找到config.json的信息,我有冲突,并且无法在主机上找到它.
I have conflicting information on where to find the config.json, and am unable to find it on my host.
|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 |
我还可以检查其他哪些位置,以及如何确定将要位于哪个位置?是否在某处进行了配置,这是否取决于docker,contained,runc或其他版本的版本?
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?
推荐答案
@ lin.qian的答案为我节省了时间.config.json现在位于/run/containerd/io.containerd.runtime.v1.linux/moby/
中,而不是问题帖子中提到的所有其他位置.
@lin.qian 's answer saves me hours. 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.
实际上,如果您进一步想将此配置文件与runc一起使用,则需要进行修改
Actually if you further want to use this config file with runc, you need modify
- root
并从安装"中删除以下内容
and remove the following from "mounts"
- "/etc/hosts"
- "/etc/hostname"
- "/dev/shm"
并删除钩子"
这篇关于从Docker容器获取Runc config.json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!