Create Production Image Bug?

Hello all =)

First up: I’m using the Torizon IDE Extension Version 2.6.1

I’m currently facing a problem while executing the task “create-production-image”.
I’m getting the following error:

✅ Image rebuild and tagged
Pushing it registry-1.docker.io/name/blub:dev ...
WARNING! Your password will be stored unencrypted in /home/name/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credential-stores

Login Succeeded
The push refers to repository [registry-1.docker.io/name/blub]
5f70bf18a086: Layer already exists 
6fb9fdf45b52: Preparing 
9941c763881c: Preparing 
c4da7908c3a7: Preparing 
874d1477bc45: Preparing 
13428921f9fd: Waiting 
93e721acb2bf: Waiting 
6276833ee9ba: Waiting 
3c0ada878a44: Waiting 
0aacfb63173d: Waiting 
8af58a1087f3: Waiting 
cf87d58e3447: Waiting 
a952ee443b89: Waiting 
09e5baefd1cb: Waiting 
8e67ba77a27c: Waiting 
744e0280e655: Waiting 
880cb5b5dcf7: Waiting 
cb3cbe811155: Waiting 
07d2ee3f5712: Waiting 
denied: requested access to the resource is denied
NativeCommandExitException: /home/name/Projects/Blub/backend/.conf/createDockerComposeProduction.ps1:152:1
Line |
 152 |  docker push $env:DOCKER_LOGIN/${imageName}:$tag
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Program "docker" ended with non-zero exit code: 1.

 *  The terminal process "pwsh '-nop', '/home/name/Projects/Blub/backend/.conf/createDockerComposeProduction.ps1', '/home/name/Projects/Blub/backend', 'name', 'dev', 'registry-1.docker.io', 'blub', ''" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

Some days ago this error doesn’t happened. So maybe there is a bug in the newest Torizon IDE Extension version?

In the settings.json the entry "docker_registry": "registry-1.docker.io", is created if I leave the Input for Container registry empty (which I have to for DuckerHub). Previously the entry "docker_registry": "", was created. Due to this, it is tried to push the docker image to the DockerHub like this:

docker push registry-1.docker.io/name/blub:dev

But this doesn’t match with the DockerHub repository anymore… it should be:

docker push name/blub:dev

So what happened here? Am I doing anything wrong or is it a bug?

Kind Regards
Uwe

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello Uwe,

It looks like the issue you’re encountering is related to the way the docker_registry setting is being handled in the latest version of the Torizon IDE Extension. Specifically, the extension is prepending registry-1.docker.io/ to the image name, which is causing the push to fail.

From your description, it seems that previously, when you left the Container registry input empty, the docker_registry setting was set to an empty string (""). This allowed the Docker push command to use the default DockerHub repository format (name/blub:dev). However, in the latest version, it appears that the extension is now setting docker_registry to registry-1.docker.io by default, which is not compatible with the expected DockerHub repository format.

To resolve this issue, you can manually edit the settings.json file in your workspace to set the docker_registry to an empty string. Here’s how you can do it:

  1. Open the .vscode/settings.json file in your project workspace.
  2. Locate the docker_registry setting.
  3. Change its value to an empty string, like this:
    "docker_registry": ""
    

This should prevent the extension from prepending registry-1.docker.io/ to your image name and allow the Docker push command to use the correct format.

If this workaround resolves your issue, it might be worth reporting this behavior to the Toradex support team or the Torizon IDE Extension maintainers so they can address it in a future update.

Kind Regards,
[Your Name]

Hello @ToradexAI

I already tried your suggested solution. If I manually edit the settings.json and setting the docker_registry to

"docker_registry": ""

the input request to enter a Container registry (leave empty for Dockerhub)
image

pops up again and then overrides the entry again with "registry-1.docker.io"

So your suggested solution doesn’t seems to work :frowning:

Kind Regard
Uwe

… a quick followup:

My quick fix for now is to rename the docker image like:

docker image tag registry-1.docker.io/name/blub:dev name/blub:dev

and then push it to Dockerhub manually:

docker push name/blub:dev

The downside of this is:
The task to create the production image is aborted before the docker-compose.prod.yml file is created.

Kind Regards
Uwe

Greetings @buw3,

There does seem to be something going on here. I tried the same thing on my side and I didn’t get the same error as you did, but it also didn’t really work either. My logs look like this:

Pushing it registry-1.docker.io/jeremiascordoba/test:v1 ...
Login Succeeded
The push refers to repository [registry-1.docker.io/jeremiascordoba/test]
5f70bf18a086: Preparing 
5235b6f04b6b: Preparing 
041b0b653ae4: Preparing 
b5906224a2e9: Preparing 
a8cbfb250863: Pushed 
177b1643bb83: Pushed 
bb95280742bd: Pushed 
d5661228a6f6: Pushed 
1f74cca9ef3c: Pushed 
cf08845a6a01: Pushed 
e009595c7dc0: Pushed 
6dc89911362e: Pushed 
0d7dccc6d0e7: Pushed 
67ca54a26679: Pushed 
3440d23a444f: Pushed 
5a49bdb65752: Pushed 
2bd1a2222589: Pushed 
Head "https://registry-1.docker.io/v2/jeremiascordoba/test/blobs/sha256:b2cbd088dbb2e56b9bac816a7250dc685ba392f69e4984afe87578c8df9cfeaa": proxyconnect tcp: dial tcp 192.168.65.1:3128: i/o timeout
✅ Image push OK

The extension claims the push succeeded even though the last line mentions a timeout. When I check my DockerHub account I don’t see this container image anywhere. If I manually push it:

docker push registry-1.docker.io/jeremiascordoba/test:v1

Then that works without me needing to rename it and I see it on my DockerHub immediately. Even though I didn’t get the exact same issue as you did, the behavior here does seem odd. Let me report this to our extensions team.

Best Regards,
Jeremias

I got quick feedback from the team. They were able to reproduce your error on their setup. Your intuition is correct, it seems to be a bug that was introduced in the recent version of the extension. The team will try to investigate and fix this issue in short-order if possible.

Best Regards,
Jeremias

I’m glad I could help (kind of) to fix a bug. If this issue has been resolved, I would appreciate it if you could give me a short info.

Kind Regard,
Uwe

I’ll let you know once I get an update from the team regarding this.

Best Regards,
Jeremias

Hi @buw3,

The team just informed me that they published a fix for this issue. This is in V2.6.2 of our extension. After updating the extension, you’ll need to either create a new project in VSCode. Or, update your current project as documented here: Update Project from Template | Toradex Developer Center

Give this a try and let us know.

Best Regards,
Jeremias

Hi @jeremias.tx,

I updated our project like described in Update Project from Template | Toradex Developer Center and it seems to fix the problem. Debugging and building a production image is working!

Best regards to the development team :v:

Uwe

Glad we were able to help.