在启动时使用azure部署清单初始化容器上的绑定挂载时,我希望得到任何帮助,这使得容器可以在azure IoT边缘运行时环境中运行。
对于上下文,如果我创建一个docker-compose文件来启动容器,它看起来像这样:
version: '3'
services:
Test_module:
image: Test_module
restart: always
build: .
ports:
- 8080
volumes:
- type: bind
source: <Insert source path on windows machine>
target: <Insert target path inside docker container>我想创建一个提供相同功能的azure部署清单。我如何才能做到这一点?
我的清单文件当前如下所示:
...
"modules": {
"Test_moduleSolution": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "<My image from private container repository>",
"createOptions": {}
},
"HostConfig":{
"Binds": "<Insert source path on windows machine>:<Insert target path inside docker container>"
}
}
}
}
},
"$edgeHub": {
....在构建和运行时,这不会在我的docker容器中创建入口。
谢谢你的帮助。
发布于 2021-02-11 19:45:14
下面是一个工作部署的代码片段。Binds需要一个包含字符串的数组。此示例适用于Linux设备。
"modules":{
"ModuleName":{
"settings":{
"image":"$<My image from private container repository>",
"createOptions":{
"HostConfig":{
"Binds":[
"/hostfolder:/folder/in/container"
]
}
}
},
"type":"docker",
"version":"1.0.0",
"status":"running",
"restartPolicy":"always"
}
}https://stackoverflow.com/questions/66153369
复制相似问题