This will explain how you can save a custom docker container to an SD card, and then use that to commission a new PFC with the same container (saving time and reducing human error).
Save the image:
-
Shell (ssh) to the controller with the running container you wish to save off. Insert a blank SD card. Ensure container does not have volumes attached for best results (docker run command did not have -v parameter used).
-
Type:
docker container ls
Note the container id of the image you want to save, in this example 533ffc3cbbfe. Type:
docker commit 533ffc3cbbfe mycontainer:v3
Verify the image was created by typing;
docker images
-
Save the image to a tar file to a blank SD card. Note: this can take quite some time, you might want to stop all running containers, etc… Type:
docker save -o /media/sd/mycontainer-v3.tar mycontainer:v3
Verify file created by typing:
ls /media/sd/mycontainer-v3.tar
Load the image:
-
Shell (ssh) to the controller and type;
cd /media/sd
-
Load the image from the SD card with the saved tar file. (in this case node-red.tar)
docker load --input mycontainer-v3.tar
-
Start the container with the new image: (for example)
docker run mycontainer:v3