Optimized image reuse across multiple services?

I am working on a project where I am deploying multiple services using a docker-compose.yml file. All services use the same image with different commands. I have noticed that the same image is uploaded to different registry endpoints multiple times and each service downloads this image separately instead of reusing the downloaded image. This results in increased deployment time and bandwidth usage.

I have created a simple docker-compose.yml as an example to illustrate this issue:

yamlCopy code

version: '3'
services:
  service1:
    image: my_image
    command: ["./script1.sh"]
  service2:
    image: my_image
    command: ["./script2.sh"]
  service3:
    image: my_image
    command: ["./script3.sh"]

In this configuration, my_image is uploaded multiple times to the Balena registry and each service downloads it separately instead of sharing the image.

I was hoping to find a way to optimize this process so that the image is uploaded and downloaded only once, and reused across all services to save time and bandwidth.

Could you please advise if there is any way to achieve this optimization on the Balena platform?

1 Like

Hello @PatrickHallek first of all welcome to the balena community.

I think you made a great point. Currently we are using the roadmap balena platform to get feature requests from our community. Would you like to introduce this optimization into the roadmap?

Happy to get more ideas!