Invalid reference format: repository name must be lowercase

I am getting this error when pushing a simple application to my balena cloud app:

(venv) work@work-MS-7788:/media/work/VisoAgent$ git push balena master
Counting objects: 34, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (27/27), done.
Writing objects: 100% (34/34), 4.82 KiB | 0 bytes/s, done.
Total 34 (delta 9), reused 0 (delta 0)

[Info]     Starting build for test_nuc, user g_shane_carlyon
[Info]     Dashboard link: https://dashboard.balena-cloud.com/apps/1471848/devices
[Info]     Building on x64_01
[Info]     Pulling previous images for caching purposes...
[Success]  Successfully pulled cache images
[main]     Step 1/8 : FROM balenalib/%%BALENA_MACHINE_NAME%%-python:3-stretch-run
[main]     invalid reference format: repository name must be lowercase
[Error]    Some services failed to build:
[Error]      Service: main
[Error]        Error: invalid reference format: repository name must be lowercase
[Error]    Not deploying release.

And here is the 1st line of my Dockerfile:

FROM balenalib/%%BALENA_MACHINE_NAME%%-python:3-stretch-run

Maybe a stupid bug?

Hi @scarlyon,

%%BALENA_MACHINE_NAME%% is a special variable and you can use it only in the template file (you can find more details in our docs here https://www.balena.io/docs/learn/deploy/deployment/#template-files). Since you’re using a Dockerfile, please specify a proper Docker image name instead.

Hi, @nghiant2710

Thanks for your quick reply!

Hmm, I wanted to create a “general” service which can be used in various type of devices… :innocent:

Any idea?

Cheers,
Shane.

@scarlyon, as mentioned in the docs I sent, you can do it by changing the Dockerfile name to Dockerfile.template then push again.

1 Like