I currently have a Docker instance running on a PI3+ with the following images on separate containers:
as these three image share a lot of common libraries (i.e. mono) I am wondering if there is a way to reduce their memory and CPU-usage footprint.
In order to do this I was looking at two possibilities:
1) building and mantaining my own image (based on the one by lsioarmhf on github) to include the three images
2) using docker compose
Can anyone please tell me if docker compose would reduce the memory footprint of the common elements of similar images?
Would it be the same of executing three separate containers?
Thanks,
No, docker-compose
orchestrates your containers, it doesn't combine their runtime resources in any way. For simple setups it's virtually the same as you starting all 3 manually.
There is no way to do that with docker at all, actually. The images might share disk space but the runtime has to be different, because they're different instances.
Since it looks like you're using a PI3+ as a dedicated board for this project, you might be better off not using Docker at all. If you need it for another project, another microSD card is inexpensive enough to start from scratch, if you're worried about isolation.