Use of local docker images for a local mode deployment

Hi,
I’m trying to do local development but also want to use prebuilt images.
I’m hoping to be able to push a docker-compose file that only contains images for the different services, so that balena doesn’t try to rebuild or retag.
Here’s what I tried:

balena build --docker //./pipe/docker_engine -f MyFleet
This creates an image in my local docker repo in format myproj_service:latest
I can deploy it to my fleet:
balena deploy MyFleet myproj_service
but that doesn’t ripple through to my device as it’s running in local mode
If I use this local docker in a docker-compose.yaml and balena push it to my local device, it doesn’t find it, as the device is looking only to external repos.

Another thing that I tried is to export the image first to a tar file (docker save), put it on flash disk, mount that on the device and import it in balena:
balena image import service.tar
Although it’s imported, it doesn’t take over the tag from the tar file, so I tag it:
balena image tag 3484c2b262d7 docker.io/service:latest
Again when using this tag in the docker-compose, it doesn’t find it which is weird that balena doesnot check its own repository before trying to pull it.

Any pointers?
I’ll now try to push my repos to private dockerhub and hope that works

Hello @bartjanszoon

Let me try to understand what you are trying to do here:

  • You have your “test” device in local mode.
  • You want to deploy the project you are building locally to this device in local mode.

Reading the Local mode requirements here i see that you need to use balena push to deploy locally. Have in mind that the code pushed in local mode is not going to be built in the balena builders but through the balena CLI.

Does this work for you?

Hi @mpous ,
as we have a set-up with ± 10 services, pushing everything to the local device everytime we make a small change to one service or the configuration, takes too long. So I want to decouple the building of the images and their configuration (docker-compose).
I’m now working by building them on another raspberry pi with docker and pushing the images to my docker hub account.

1 Like