Code Monkey home page Code Monkey logo

Comments (2)

david-emakenemi avatar david-emakenemi commented on June 13, 2024

Hey @tchochunk, here are some good documentations that we have that covers how to configure container create options for IoT Edge modules and modules access to a device's local storage. Let us know if this helps.

from iotedge.

tcochunk avatar tcochunk commented on June 13, 2024

@david-emakenemi thank you for the response. I read both those articles and if I copy the HostConfig section from modules access to a device's local storage and use that with my information, it does work. But I dont know what it does. After reading several sites, it seems that Volumes are better than binds but i cant find any documentation on implementing Volumes. While I have a working example, I dont have an understanding of what is happening and the 2 articles are focused on a very small subset of the options available.

I guess I am looking for additional documentation so I will keep searching.
Sincerely, Thank You.

UPDATE: so i made some progress and my conclusion is to carefully read and study the documentation on the docker website https://docs.docker.com/engine/api/v1.30/#tag/Container/operation/ContainerCreate. After this post and following my own advice i came up with the following couple of solutions:

The following config will work (as @david-emakenemi referenced) and the data stored will survive container restarts and deploys:
{
"HostConfig": {
"Mounts": [
{
"Type": "bind",
"Source": "/srv/db/data",
"Target": "/data",
"ReadOnly": false
}
]
}
}

The following also works but creates a volume that maps to the docker managed location (/var/lib/docker/volumes). while i can specify the volume name i did not see a way to specify the source location. maybe i could make the volume separately and specify the location there and just reference that volume here???
{
"HostConfig": {
"Mounts": [
{
"Type": "volume",
"Source": "desiredVolumeName",
"Target": "/data",
"ReadOnly": false
}
]
}
}

from iotedge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.