I was used to doing this in the Dockerfile
, using one of these approaches (currently the systemd
one). Just wondering how this applies to multicontainer. How to make it so the individual services have access to the SD card? Should I run the services that need the SD card in privileged
mode in docker-compose.yml
, and then mount the SD card in the individual Dockerfile
s? Then what happens when multiple services mount the SD card separately?
You should be able to use the Docker compose volumes
field to do this. There are a few limitations (as outlined in the resin docs) but you should be able to find more info in the Docker compose documentation.
I quite like the idea. How to mount the SD card in the first place though? From what I understand, the SD card must be mounted before I can use it in the volumes section of a service. Then yes I agree exposing volumes in the individual Dockerfiles and binding them in the docker-compose looks like the best approach.
@mccollam: any update to share? I still do not get how to mount the SD card so it can actually be used in the volumes
section. Or do you mean it gets mounted automagically on startup due to a multicontainer-specific trick?