Torizon IDE Extension: create-production-image with Azure Container Registry (ACR)

I’ve just created a new cConsole Torizon project, using Torizon IDE Extension v2.5.2.
I’m able to use some of the pre-built tasks (check-deps, build-debug-arm64, try-update-template, …).
Now I need to build the release artifact (i.e., the container image with my application), and pushing it to my private container registry. I use Azure Container Registry (instead of Dockerhub).
I run create-production-image task and I must fill-in some parameters, but it’s not clear to me how should I use the parameters:

  • docker_registry
  • docker_login

In my idea, docker_registry should be my registry (i.e., <organization_name>.azurecr.io for ACR), and docker_login should be the the identity who has the rights to push the image into the registry.
But the script createDockerComposeProduction.ps1 uses the above parameters in weird way.

I see the following lines:

$env:LOCAL_REGISTRY="$($localRegistry):5002"
$env:TAG="$tag"
if ([string]::IsNullOrEmpty($registry)) {
    $env:DOCKER_LOGIN="$dockerLogin"
} else {
    $env:DOCKER_LOGIN="$registry/$dockerLogin"
}

and so if docker_registry is not empty, docker_registry and docker_login are concatenated.
And so I get
Pushing it <organization_name>.azurecr.io/docker_login/tcb.packageName:docker_tag
but this is wrong for Azure Container Registry, because docker_login must not be included in the link.
The right link is
Pushing it <organization_name>.azurecr.io/tcb.packageName:docker_tag

I changed the scrip createDockerComposeProduction.ps1 setting

$env:DOCKER_LOGIN="$registry"

and in this way everything is of with Azure Container Registry.

Do you think that the default script can be changed so that ACR can work out of the box?
Thanks

Greetings @vix,

Let me bring this up with our IDE extension team and see what is intended and what can be improved here if possible.

Best Regards,
Jeremias

After briefly speaking with our IDE team, this use-case makes sense to them. They’ll look into how to better improve the overall IDE extension, to better support various kinds of container registries including ACR.

Best Regards,
Jeremias

1 Like