在docker inspect中,字段"MountLabel"和"ProcessLabel"分别指什么?

3
执行命令docker inspect <container id>时,输出结果包含许多字段,但我无法找到MountLabelProcessLabel的含义。
我从源代码中获得了一条注释:
// MountLabel contains the options for the 'mount' command 

以下是一些来自RedHat的示例:

# buildah inspect myecho-working-container | less
{
    "type": "buildah 0.0.1",
    "image": "docker.io/library/myecho:latest",
    "image-id": "e2b190ac8a37737ec03cfa4c9bfd989845b9bec3aa81ff48d8350d7418d748f6",
    "config": "eyJjcmV...
    "container-name": "myecho-working-container",
    "container-id": "70f22e886310bba26bb57ca7afa39fd19af2791c4c66067cb6206b7c3ebdcd20",
    "process-label": "system_u:system_r:svirt_lxc_net_t:s0:c225,c716",
    "mount-label": "system_u:object_r:svirt_sandbox_file_t:s0:c225,c716",
    "ociv1": {
        "created": "2017-10-12T15:15:00.207103Z",
        "author": "Red Hat, Inc.",
        "architecture": "amd64",

而我们需要翻译的内容是来自 fsouza/go-dockerclient 中定义了包含这两个字段的容器类型。

但我仍然无法理解这两个字段MountLabel和ProcessLabel的含义。

1个回答

0

mount-label 是挂载的 SELinux 标签(字符串)。

process-label 是进程的 SELinux 标签(字符串)。

参考:


根据ref,docker inspect的其他字段具有以下含义:
使用给定的Go模板格式化输出。返回的JSON的键可以用作--format标志的值(请参见下面的示例)。
下面列出了Go模板的有效占位符:
占位符 描述
占位符 描述
.AppArmorProfile AppArmor配置文件(字符串)
.Args 命令行参数(字符串数组)
.BoundingCaps 边界能力集(字符串数组)
.Config ... 包含配置信息的结构体
.ConmonPidFile 包含conmon pid的文件路径(字符串)
.Created 容器创建时间(字符串,ISO3601格式)
.Dependencies 依赖项(字符串数组)
.Driver 存储驱动程序(字符串)
.EffectiveCaps 有效能力集(字符串数组)
.ExecIDs 执行ID(字符串数组)
.GraphDriver ... 图形驱动程序的详细信息(结构体)
.HostConfig ... 主机配置详细信息(结构体)
.HostnamePath 包含主机名的文件路径(字符串)
.HostsPath 容器/etc/hosts文件的路径(字符串)
.ID 容器ID(完整的64位哈希值)
.Image 容器镜像ID(64位哈希值)
.ImageName 容器镜像名称(字符串)
.IsInfra 这是一个基础设施容器吗?(字符串:true/false)
.IsService 这是一个服务容器吗?(字符串:true/false)
.MountLabel 挂载的SELinux标签(字符串)
.Mounts 挂载点(字符串数组)
.Name 容器名称(字符串)
.Namespace 容器命名空间(字符串)
.NetworkSettings ... 网络设置(结构体)
.OCIConfigPath OCI配置文件的路径(字符串)
.OCIRuntime OCI运行时名称(字符串)
.Path 容器命令的路径(字符串)
.PidFile 包含容器PID的文件路径(字符串)
.Pod 父级Pod(字符串)
.ProcessLabel 进程的SELinux标签(字符串)
.ResolvConfPath 容器resolv.conf文件的路径(字符串)
.RestartCount 容器重新启动的次数(整数)
.Rootfs 容器根文件系统(字符串)
.SizeRootFs 根文件系统的大小,以字节为单位
.SizeRw</

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接