by joshvm · 7y ago · 0 comments
Yes, you can clone the SD card, but I think it's cleaner to use a version-controlled Dockerfile. Otherwise you always need some master SD card to clone from (and keep track of a multi-GB image file), and you have to faff with resizing images if the new card is smaller.
A fresh system install is then: flash Raspbian, update system, setup some init scripts, install docker, pull the image and clone the latest version of the code from github.
This is also the approach embraced by Balena, who (conveniently) provide Docker base images for a bunch of common embedded systems.
Another reasonably big user-base is machine learning.
None of it really requires docker, but it's nice to have the whole environment encapsulated, and having a record of what I had to do to get some of these things to install is invaluable.
I have a shell script which launches the container (I just run a new one) every time the Pi boots.