Supported docker-compose versions

Hi all,

Relative newbie to open balena - but I’m trying to make a new app to deploy a docker-compose file, but we need support for version 3.7. From changing the version numbers, it seems like the highest working version is 2.

Is there some way to work around this?

Our existing docker-compose.yml file requires features from 3.7…

Hi Steve, there’s no way to work around Docker compose features that aren’t implemented but perhaps if you share specifically what you’re trying to do and what features you’re missing, we may be able to suggest a workaround for that. For reference, you can see what features are supported here: https://www.balena.io/docs/reference/supervisor/docker-compose/

Thanks Chris,

I’m discussing this with our development team to see what we can do and if we are able to work around this limitation.

I should mention that we don’t want to build packages via openBalena - as we have our own CI system and CR that we can pull things from. As such, we only really need to push the docker-compose.yml to the device to be executed. All pulls can come from our existing infrastructure.

Right now, we’re using a base OS and implementing most things on our own - but our goal is to move to BalenaOS. Whilst this is kind of changing the topic, can you confirm that the A/B flashing works with OpenBalena and we are able to upgrade remote devices via openBalena using these features? I’m finding it difficult to find the correct documentation on various features.

Hey Steve, let us know what exactly you need from 3.x to see if what you want to do is achievable, but since you’re doing the builds in a separate system, I assume it shouldn’t be an issue to just link the images in the docker-compose that you’ll push to openBalena.

Regarding A/B flashing, I assume you mean doing hostOS updates that support rollbacks? Currently that is not supported in openBalena (which is one of the reasons we still keep it in beta), at least without some manual on-device intervention using SSH, but it is definitely on the roadmap. You can find more info how to do it here: Roadmap for BalenaOS Updates in OpenBalena, but I’ll double-check with the team if that is still up to date.

Hi there,

Just to clarify what my colleague said is still the most accurate method, though since it’s not “officially” supported your mileage may vary until that feature is fully implemented and we move out of beta.

Please do clarify what you mean about A/B flashing, in case we’ve misunderstood!

Hi Matthew,

You’re right on the money regarding the A/B flashing - I guess I’m injecting the Android terms into the discussion due to the $prefixA and $prefixB partitions shown when mounting the SD card in a PC.

If I understand it right, this is the same method for updating the BalenaOS images (although having manual steps right now) - the update goes to the non-active ‘slot’ and is switched by a reboot after update.

I’m yet to sit down with our developers to see what specifics are in the docker-compose.yml we use, hopefully I’ll get to look at that today.

Thanks for clarifying, your understanding of how balenaOS updates work under the hood is correct! Here’s a bit more about the other partitions and disk layout: https://www.balena.io/os/docs/architecture/#Image-Partition-Layout

Do let us know when you figure out what’s required in docker-compose!

It seems the commands we use that are not currently supported are:

  • init: true
  • runtime: nvidia
  • bind mounts

Likely, these would allow our applications to run out of the box - however we do believe we may be able to work around the majority of these. These do however add a number of layers of complexity to the existing projects.

Hey Steve

thanks for the additional info

  • for init:true I believe this should work as we have tini in balenaOS. see here . but i have no personally used this before
  • as for runtime: nvidia can you please clarify? do you want to use GPU found on the device? what device type are you using please?
  • As for bind mounts, are you expecting to mount arbitrary file or directory on the host machine into a container? we do not support that yet but mayeb some of the labels listed here would do the job? otherwise, you can find an example of a workaround here

hope this is helpful.

Cheers

We’ll have to give it a try - we just looked at the differences between the v2 and v3.7 specification.

Yes, we need to use the GPU component as for cuda processing. The device is a nVidia Jetson Nano (SD card).

At the moment, we have a directory mapped in which contains all the config files. This is delivered with the docker-compose.yml file. I’ll pass the links above to our dev guys for comment. Some of them know the internals of Docker much better than I do.

Hi folks,

I just want to leave a comment regarding supported compose format versions. In our company it is becoming more and more a pain being bound to v2.
We are supporting different deployment types, one of them is through balena. Having a “base” docker-compose.yml for native deployments and a docker-compose.balena.yml override for balena specifics works very well for us technically. But as a side effect our base compose file is limited to the version that balena supports.
We want to switch to v3 and are open for suggestions how this can be solved (or worked around?).

To demonstrate how we generate the compose file for our balena deployments this is what we currently do:
docker-compose -f docker-compose.yml -f docker-compose.balena.yml configure > balena-release.yml

Cheers,
Marius

Hi Marius,

Can you please specify what exactly you need in the new docker compose version?

We might perhaps offer other means to achieve what you require. Additionally, knowing the exact features you are interested in would help us evaluate how best to address the need.

Having said these, I also internally raised the wider question of supporting docker compose v3.

Cheers…

Hello Marius,

Earlier in this thread you asked about NVIDIA support. After you wrote that, we did a blog post on that general topic. It’s not docker-compose specific, but you may find it helpful. https://www.balena.io/blog/how-to-use-nvidia-jetson-devices-on-balenaos/

Ross

It’s not a show-stopper for us, but simply a matter of convenience, so I just wanted to follow-up if there is any news on docker v3 support?

Dave

Hello Dave,

Thanks for following up. Right now there are no activities to support docker-compose v3 specification.

Best Regards
Harald

Hello,

I wanted to follow up on that docker-dompose v3 topic, and ask if there is anything happening or planed on docker v3 support.

Best regards
Elias

docker compose 1.28.x require the docker engine 19.03,0 or higher, it is recommended to use this version of docker compose if you have docker engine 19,03.x or later installed,