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

git
docker-compose

#1

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?


#4

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).


#7

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?


#9

@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).


#10

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?