Rename name of image in local mode

Hello,

I build an image through docker-compose file and a docker file in local mode, using the command : balena push local_ip .
When the build finish i can see the new image and the container that run that image. Everything works fine. The default name of the image is local_image_app:latest.
Now i m trying through docker-compose file to change that name and use a name that i want adding the line image: service1:tag1 after the line build .
When the build finish i see in terminal :
[Logs] [8/9/2019, 4:07:13 PM] Installing service 'app local_image_app:latest’
[Logs] [8/9/2019, 4:07:14 PM] Installing service 'app local_image_app:latest’
[Logs] [8/9/2019, 4:07:17 PM] Installing service 'app local_image_app:latest’
[Logs] [8/9/2019, 4:07:21 PM] Installing service 'app local_image_app:latest’
[Logs] [8/9/2019, 4:07:29 PM] Installing service 'app local_image_app:latest’
[Logs] [8/9/2019, 4:07:45 PM] Installing service 'app local_image_app:latest’
[Logs] [8/9/2019, 4:08:18 PM] Installing service 'app local_image_app:latest’
[Logs] [8/9/2019, 4:09:22 PM] Installing service 'app local_image_app:latest’
[Logs] [8/9/2019, 4:11:30 PM] Installing service 'app local_image_app:latest’
[Logs] [8/9/2019, 4:15:46 PM] Installing service 'app local_image_app:latest’
[Logs] [8/9/2019, 4:24:18 PM] Installing service 'app local_image_app:latest’
After a while the connection lost in terminal ([Error] Connection to device lost).
The image exists in HostOs with name service1:tag1 but the container dont start automatically as before. i have to run it manually.
Also When i get the state with command curl “http://127.0.0.1:48484/v2/local/target-state , in the output i see the field “image”:“local_image_app:latest”.
Why happens that? how is the right way to name the images that i build (in local mode) as i want?

Thanks

Hello @xamsak, could you share the docker-compose file you are using along with the Dockerfile so I can take a look?
Thank you

yes i can…see the attached file.
thank you


Απαλλαγμένο από ιούς. www.avast.com

Στις Παρ, 9 Αυγ 2019 στις 5:16 μ.μ., ο/η Daniel Andrade via balenaForums balena@discoursemail.com έγραψε:

(Attachment docker-compose.yml is missing)

@xamsak can you add the files via the forum https://forums.balena.io instead of email.

Thank you

docker-compose
ok. i sent here as png file.
thanks

@xamsak we are looking into this.
We managed to reproduce your problem at least to a part and we are trying to find out internally how this is meant to work.

Hey @xamsak

I’m not completely sure what exactly you are trying to achieve. For what reason do you want to change the image name?

Local mode was never designed with this in mind, so if I could understand your use case a little better, maybe it’s something we can at least partially support.

Hello,

I am reopening this thread because I am running into the same issue now. I want to use docker-compose.yml to run a single service on a device in local mode.

The reason to do this is because balena push does not allow for Dockerfile build args, and balena deploy is not available for local mode, so using docker-compose seems like the way to go.

To sum up the problem again: The image field in the service of the docker-compose.yml is correctly picked up by the builder and the resulting image on the device is tagged accordingly. However, the command sent to start/enable the service uses “local_image_main:latest” as the image name and that does not exist on the device.

It is a small issue and easy to work around, but maybe it is also an easy fix for you.

Thank you