Hi Have created custom IoT edge modules which require read and write operations to files inside a directory present in IoT edge server. Earlier I was using Docker desktop to build the modules so I was able to give read/write permission to the modules by referring this doc - Add local storage to Azure IoT Edge modules using Docker Bind But now when I am building similar IoT edge Module requiring read/write operation, with podman desktop so now the container is not even starting. on the IoT Edge Server when I checked the container, it gives the following error -
Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:75: mounting "/var/SampleModule" to rootfs at "/app/SampleModule" caused: mount through procfd: open o_path procfd: open /var/lib/docker/overlay2/871b2e9e4e03.../merged/app/SampleModule: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
Below is the deployment.template.json used for build and deployment
{
"$schema-template": "4.0.0",
"modulesContent": {
"$edgeAgent": {
"properties.desired": {
"schemaVersion": "1.1",
"runtime": {
"type": "docker",
"settings": {
"minDockerVersion": "v1.25",
"loggingOptions": "",
"registryCredentials": {
"<Container Registry Name>": {
"username": "$CONTAINER_REGISTRY_USERNAME_<Container Registry Name>",
"password": "$CONTAINER_REGISTRY_PASSWORD_<Container Registry Name>",
"address": "<Container Registry hostname>"
}
}
}
},
"systemModules": {
"edgeAgent": {
"type": "docker",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-agent:1.4",
"createOptions": {}
}
},
"edgeHub": {
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-hub:1.4",
"createOptions": {
"HostConfig": {
"PortBindings": {
"5671/tcp": [
{
"HostPort": "5671"
}
],
"443/tcp": [
{
"HostPort": "443"
}
]
}
}
}
}
}
},
"modules": {
"SampleModule": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "${MODULES.SampleModule}",
"createOptions": {
"HostConfig": {
"Binds": [
"/var/SampleModule/data:/app/SampleModule/data"
]
}
}
}
},
"SimulatedTemperatureSensor": {
"version": "1.0",
"type": "docker",
"status": "running",
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.4",
"createOptions": {}
}
}
}
}
},
"$edgeHub": {
"properties.desired": {
"schemaVersion": "1.2",
"routes": {
"SampleModuleToIoTHub": "FROM /messages/modules/SampleModule/outputs/* INTO $upstream",
"sensorToSampleModule": "FROM /messages/modules/SimulatedTemperatureSensor/outputs/temperatureOutput INTO BrokeredEndpoint(\"/modules/SampleModule/inputs/input1\")"
},
"storeAndForwardConfiguration": {
"timeToLiveSecs": 7200
}
}
}
}
}
How can I resolve this issue?