balena deploy not tagging images correctly

Hi there guys,

We have a docker-compose.yaml similar to this:

version: '2'
volumes:
  mydata:
services:
  myservice:
    build: ./services/myservice
    volumes:
      - "mydata:/mydata"

We are deploying using balena deploy

$ balena deploy my-app --projectName myproject --multi-dockerignore --tag 1.1.0

We expected the local images to be named myproject_myservice:1.1.0 but it is always tagged as `latest’.

Any hints on what we could be doing wrong?

hello, what version of the CLI are you using, thanks

Hi there, I reproduced the problem that you described on my own machine – after some digging it turns out that this is a known issue with the CLI, that we have noted here: Deploy command ignores --tag argument · Issue #1018 · balena-io/balena-cli · GitHub . THe --tag flag seemingly gets ignored by balena deploy. I will link this issue to this forum thread, so that when we have fixed it, someone will notify you.

In the meantime, I did some experimenting, and I found that if I used this command: balena deploy ryan-app --projectName myproject:v1.1.1 then my image was tagged as myprject:v1.1.1_main - maybe this will help in the meantime? Thanks

1 Like

Hi Rodrigo. Three months later… Just dropping a note that the --tag option of the balena build and balena deploy commands was fixed in balena CLI version 12.48.11 (or later). Locally built images are named in the format “projectName_serviceName:tag”, where:

  • “projectName” is the value of the --projectName option. The default value is the project directory name (last path component only).
  • “serviceName” is the name of the service as defined in the docker-compose.yml file (each service produces a separate image). If a docker-compose.yml file does not exist, a single image is created and the default value of “serviceName” is “main”.
  • “tag” is the value of the --tag option. The default value is “latest”.

Thank you for reporting this issue and let us know if you have further questions.
Paulo