如何将 apparmor 配置文件应用于 IoT Edge 模块?
背景,
如果我运行 docker run -it --security-opt apparmor=docker-azureiotsecurity hello-world
,我将看到容器使用正确的 apparmor 配置文件运行。如果我检查容器,它是正确的:
docker inspect quizzical_jang
[
{
"Id": "c1bcfe266946b5393c279cba7ac21ea2ed00d47b75c2ae613db7fbd7a0f0faca",
...
"ProcessLabel": "",
"AppArmorProfile": "docker-azureiotsecurity",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
...
"ReadonlyRootfs": false,
"SecurityOpt": [
"apparmor=docker-azureiotsecurity"
],
"UTSMode": "",
...
}
}
]
如果我将设置添加到模块的 HostConfig 中,它会显示在 HostConfig 中,但它在声明中未确认。是否可以将此设置应用于我的所有主机?
docker inspect quizzical_jang
[
{
"Id": "c1bcfe266946b5393c279cba7ac21ea2ed00d47b75c2ae613db7fbd7a0f0faca",
...
"ProcessLabel": "",
"AppArmorProfile": "unconfined",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
...
"ReadonlyRootfs": false,
"SecurityOpt": [
"apparmor=docker-azureiotsecurity"
],
"UTSMode": "",
...
}
}
]```