Preloading IoT Edge containers into a device

New Contributor

Hello. I wonder if it's possible to copy the docker containers to a new device which has a matching deployment setup in IoT Edge hub, so the device can be shipped without needing to download everything. Is this possible without tainting the IoT edge footprint so it doesn't remove containers etc?

 

For example if there's a crucial container that needs to be running as fast as you turn on the  device, this is very useful.

5 Replies

@emilm Yes, you can pre-seed the images using docker import. Can you clarify what you mean by "tainting the IoT edge footprint"?

@Venkat Yalla Thank you! But doesn't docker import mean that you need to have the device running to import to it? I was thinking of avoid booting up the device. 

 

When I mean tainting, I mean that Iot Edge daemon clears all the containers when it detects that the config has changed. How to avoid this? The config needs the registration ID unless I can provide it otherwise.

How do you currently install the iotedge and docker daemons on the device?

@Venkat Yalla They are a part of the base image so not really installed. They are already there if you know what I mean. :smile: The containers are not since they are data that changes and is on a separate, writable partition. 

 

Is just copying everything under /var/lib/docker enough or do I need the entire home directory of IoT edge as well to include the deployment manifest? When IoT Edge Daemon starts up for the first time, or the config is changed (both are true for me since every device have their own registration ID) it will clear the containers and add them again.

 

@emilm Hmm, a bit confused on what you mean by they're already there. The packages do need to be installed for them to work correctly. As part of the installation script do a docker import of a .tar file.

 

Images are not modified as part of re-provisioning, only saved container instances are removed.