Skip building certain images

Hello!

Is it possible to skip building certain docker images based on environment variables?

Hello @tommyzat could you please tell us more details of the problem you are trying to solve?

Thanks!

I’m trying to skip building certain docker images (from the docker-compose file) based on whether, for instance, the name of that balena device contains the letter “S”.

@tommyzat let me try to write an example to understand what you are trying to achieve.

I imagine that you have a docker-compose with the services A and B. When the name of the device on balenaCloud (or openBalena) contains the letter A it will build only the service A on the docker-compose and not deploy the service B?

This looks like adding conditionals to the docker-compose. I don’t think this is possible at the moment (i will ask to the team).

The recommendation is to adjust the application to make all these aspects configurable.

Some ideas:

  • take a look at the contracts here

  • you can have multiple releases attached to a fleet, and move the devices among tags depending on their name.

The contracts with optional containers would be great if I could specify something myself; for instance if a label/tag is a certain value. This would be the ideal option, contracts only supports three contract types if I understood correctly

Having multiple releases is also an option, I would only need to modify my docker-compose and remove what I don’t need for that tag

1 Like

Hello @tommyzat give it a try and let us know if you succeed using the balena contracts!

Let’s stay connected

But is it possible to use contracts with labels for instance? It is specified that only three parameters are available for usage: sw.supervisor, sw.l4t, hw.device-type, none of which may be changed by me