Add our own services on Openbalena machine

Hi, wondering if an openbalena pro could give me a pointer. I’m not an expert in the atomized docker-compose method, ie. where the components like services.yml, common.yml, template.yml are separate files.

I wanted to add some other services, ie Datadog, to the stack but wasn’t sure where to define them.

I know there is the flatten to docker-compose.yml script, but unsure of that procedure too.
Does this look correct?

Step 1) Get openbalena up and running with the getting started guide scripts
Step 2) Flatten the docker-compose
Step 3) docker-compose down
Step 4) Add my services to the flattened compose
Step 5) docker-comose up -d

I think I may have been overthinking this.

I got it to work by simply doing the quickstart, setting everything up but before doing the docker up script, I did the flatten to docker-compose.yml step, added my services, and ran docker-compose up instead of using the script.

Easy peasy.

Hello, looks like that should work perfectly fine. Another approach could be to add this directly to the services.yml file, if you have a look at the compose script you can see that it is really using that as the base compose file and optionally layering other things on top of that via the standard composition of compose files (Share Compose configurations between files and projects | Docker Documentation)

1 Like

Ha I noticed that only after I decided to take the complicated route. Thanks for the tip.