Hi,
I am trying to use the python sdk to create a release for my balena fleet. The release is a multicontainer release, and the docker compose file refers to images in a private docker repo. The only way I’ve found to create a release from the python SDK is to create it from a URL: Balena Python SDK - Balena Documentation - but this does not allow for a registry-secrets input.
Is there any way to do make this work with a private docker repo?
Hi @andreas-s,
The release.create_from_url()
method creates new release from a url with a tarball of the project to build so you can just include your secrets inside your application directory (more details about how to add build time secrets can be found here Deploy to your fleet - Balena Documentation) before packing the tar file and it will work as expected.
Hi @nghiant2710 ,
Thanks for the reply. To clarify, I am trying to use base images from a private registry (hosted on google cloud). The guide you linked to takes special consideration for registry secrets; they are supplied as a command line argument rather than using the build time secret setup. Is it possible to supply the registry secrets as a build-time secret as well?
I gave it a try by creating a balena.yml file as
build-secrets:
global:
- source: registry-secrets.yml
dest: registry-secrets.yml
and the directory structure
.
├── docker-compose.yml
├── .balena
│ ├── balena.yml
│ └── secrets
│ └── registry-secrets.yml
But that did not work.
Hey @andreas-s, can you please try again with this structure .balena/registry-secrets.yml
and registry-secrets
can be a json, yml or yaml?
Hi,
Thanks again for the reply. That works! For anyone reading this in the future, I also had to not reference the file as a build secret in the balena.yml file.
Thanks for the help!