Specify a particular docker-compose.yml file when pushing to a repo

What I would like to do is specify a particular docker-compose.yml file when I am pushing to the balena remote repository.

Say I have directory structure:

├── app
│   ├── app
│   │   └── Dockerfile.template
└── docker-compose.yml
└── docker-compose2.yml

Is there a way to use a command similar to
git push balena master
to specify to use docker-compose2.yml instead of docker-compose.yml?

Hey @cnr, unfortunately this is not yet possible. I’ve created a tracking issue for this, but most likely this would be added as a flag to balena push (providing arguments to the git server can be very roundabout).

Figured that would be the case.

Do you have any recommendations about how to build on multiple arches? We want to have a fast local development process on x86 (cannot use the development mode on our device because our developer is remote, but the device is with us), coupled with a git push balena deployment process to test the code is working as expected on the destination device.

Any recommendations/best practices?

@cnr I see you’re using Dockerfile.template - that’s indeed a good way to have multi-arch builds as long as you use balena base images. Another option is using what’s described here: https://www.balena.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/ - in particular doing the binfmt_misc hack:

mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc 
echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register 

should allow you to run our base images for ARM on your x86 machine (as long as you have root access on the computer where you want to do this to run that hack).

Also, could you tell us a bit more about what’s different between your two compose files? I guess you use bind mounts in the development one?

Sorry, it has taken me a while to get back to this.

Yes, development mode has bind mounts.
Development mode also has a wrapper script that executes the container with the proper options and arguments.

We haven’t really solved the problem, we’ve just decided that we will only use one docker-compose file and that will service balenaCloud, and everything else we will call manually in development mode (with docker run or similar).

Not sure if that is helpful, but I figured I’d try to get back to you and see if I can shed some light.