0

I would applicate any help when it comes to initialising a bind-mount on a container at start-up using an azure deployment-manifest, this allows the container can run through the azure IoT edge runtime environment.
For context, if I was to create a docker-compose file to start the container it looks like this:

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>

I want to create an azure deployment manifest that gives the same functionality. How can I achieve this?
My manifest file currently looks like this:

        ...
        "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": {
     ....

This doesn't create the mouth inside my docker container when built and run.

Thanks for the help.

1 Answers1

1

Here's a snippet from a working deployment. Binds needs an array with strings. This example is for a Linux device.

"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"
      }
   }
Matthijs van der Veer
  • 3,865
  • 2
  • 12
  • 22
  • Thanks for the guidance the answer here -->(https://stackoverflow.com/questions/52572289/mount-path-to-azure-iot-edge-module) was helpful too. – Reece Fryer Feb 11 '21 at 13:44