Need to add 2 volume shares to Edge Module.
Create options need to have volumes added, but find no examples of how to do this.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@GarthOlivier are you asking about what the value should be when you're creating the container, using the volumes property? Reference: https://docs.docker.com/engine/api/v1.32/#operation/ContainerCreate
Correct that where I am looking but could not find examples to base on.
I am trying to do the following:
Automate following command
docker run -ti -v f:/:/thumbdata -v C:/:/iotdata bnsfiotreg.azurecr.io/xxxxxxxxxxxxxxxxxxxx:latest /bin/bash
This is the closest, I have to working but could not bind .... I have also tried mounts
{
"Volumes": {
"/iotdata": {} , "/thumbdata": {}
}
}
I am also trying to use create options in the set module UI.
Thanks
Garth
solved it thru a lot of trying many options.
The document linked has a lot of information but getting a solution is not easy.
Suggest samples for different problems to be listed.
answer how to share drive in docker that can be placed in createOptions:
"HostConfig": {
"Binds": [
"/host_mnt/f:/thumbdata",
"/host_mnt/c:/iotdata"
},
"Mounts": [
{
"Type": "bind",
"Source": "/host_mnt/f",
"Destination": "/thumbdata",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/host_mnt/c",
"Destination": "/iotdata",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}
]
Quite new to docker and IoT Edge, Im trying to share a volume between host and container, to do so I need to create and attach a volume when I create the container. How would I set the createOptions in the deployment.template.json to achieve that? The structure of my module "section" in the file is the following:
"modules": {
"pythonmodule": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "${MODULES.pythonmodule.amd64}",
"createOptions": "{}"
}
}
}
Thank you for your help
@GarthOlivier Thanks for sharing your solutions. Got it with your example working.
This really needs better documentation.
It has been two years, and still no proper documentation on "createOptions" anywhere on the internet? I really wish this would get more attention.
@Tam66662 Thank you for bringing this to our attention. Can you please open a new issue for this and I will link this issue with the new, and have the content team evaluate this. Thank you!
@Mike-Ubezzi-MSFT
Thanks, Mike. I have opened a new issue: https://github.com/MicrosoftDocs/azure-docs/issues/49171
Most helpful comment
@GarthOlivier Thanks for sharing your solutions. Got it with your example working.
This really needs better documentation.