question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot run program "docker-credential-ecr-login.cmd"

See original GitHub issue

Environment: git-bash

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Java version: 1.8.0_252, vendor: Azul Systems, Inc., runtime: D:\Dev\Java\jdk8x64\jre Default locale: de_DE, platform encoding: Cp1252 OS name: “windows 10”, version: “10.0”, arch: “amd64”, family: “windows”

  • Jib version: 2.4.0
  • Build tool: maven 3.6.3
  • OS: windows

Description of the issue:

I installed “docker-credential-ecr-login” … and I can use it 😃

MINGW64 /d/Dev/git/coc/spice-configuration-cluster (develop) $ docker-credential-ecr-login list
{“https://XXXXXXXXX.dkr.ecr.eu-west-1.amazonaws.com”:“AWS”}

MINGW64 /d/Dev/git/coc/spice-configuration-cluster (develop) $ docker-credential-ecr-login version
0.6.3

MINGW64 /d/Dev/git/coc/spice-configuration-cluster (develop) $ which docker-credential-ecr-login
/c/Users/hoehmann/go/bin/docker-credential-ecr-login

But inside the jib-run it doesn’t work. It seems that jib is trying to execute docker-credential-ecr-login.cmd instead of docker-credential-ecr-login.exe or docker-credential-ecr-login

Expected behavior:

docker-credential-ecr-login should work under windows-git-bash as well

Steps to reproduce:

  1. installed docker-credential-ecr-login with “go get -u github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login”
  2. add jib-maven-plugin
  3. run maven

jib-maven-plugin Configuration:

<configuration>
            <to>
              <image>${aws.ecr.url}/${finalName}:latest</image>
              <credHelper>ecr-login</credHelper>
            </to>
            <container>
              <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
              <ports>
                <port>8080</port>
              </ports>
            </container>
          </configuration>

Log output:

[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:2.4.0:build (default-cli) on project rest-service-sce: java.io.IOException: Cannot run program “docker-credential-ecr-login.cmd”: CreateProcess error=2, Das System kann die angegebene Datei nicht finden -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.google.cloud.tools:jib-maven-plugin:2.4.0:build (default-cli) on project rest-service-sce: java.io.IOException: Cannot run program “docker-credential-ecr-login.cmd”: CreateProcess error=2, Das System kann die angegebene Datei nicht finden at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: org.apache.maven.plugin.MojoExecutionException: java.io.IOException: Cannot run program “docker-credential-ecr-login.cmd”: CreateProcess error=2, Das System kann die angegebene Datei nicht finden at com.google.cloud.tools.jib.maven.BuildImageMojo.execute (BuildImageMojo.java:162) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: com.google.cloud.tools.jib.registry.credentials.CredentialRetrievalException: java.io.IOException: Cannot run program “docker-credential-ecr-login.cmd”: CreateProcess error=2, Das System kann die angegebene Datei nicht finden at com.google.cloud.tools.jib.frontend.CredentialRetrieverFactory.lambda$dockerCredentialHelper$1 (CredentialRetrieverFactory.java:150) at com.google.cloud.tools.jib.builder.steps.RegistryCredentialRetriever.retrieve (RegistryCredentialRetriever.java:47) at com.google.cloud.tools.jib.builder.steps.RegistryCredentialRetriever.getTargetImageCredential (RegistryCredentialRetriever.java:40) at com.google.cloud.tools.jib.builder.steps.AuthenticatePushStep.call (AuthenticatePushStep.java:57) at com.google.cloud.tools.jib.builder.steps.StepsRunner.lambda$authenticateBearerPush$3 (StepsRunner.java:236) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly (TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run (InterruptibleTask.java:69) at com.google.common.util.concurrent.TrustedListenableFutureTask.run (TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624) at java.lang.Thread.run (Thread.java:748) Caused by: java.io.IOException: Cannot run program “docker-credential-ecr-login.cmd”: CreateProcess error=2, Das System kann die angegebene Datei nicht finden at java.lang.ProcessBuilder.start (ProcessBuilder.java:1048) at com.google.cloud.tools.jib.registry.credentials.DockerCredentialHelper.retrieve (DockerCredentialHelper.java:132) at com.google.cloud.tools.jib.registry.credentials.DockerCredentialHelper.retrieve (DockerCredentialHelper.java:117) at com.google.cloud.tools.jib.frontend.CredentialRetrieverFactory.retrieveFromDockerCredentialHelper (CredentialRetrieverFactory.java:296) at com.google.cloud.tools.jib.frontend.CredentialRetrieverFactory.lambda$dockerCredentialHelper$1 (CredentialRetrieverFactory.java:141) at com.google.cloud.tools.jib.builder.steps.RegistryCredentialRetriever.retrieve (RegistryCredentialRetriever.java:47) at com.google.cloud.tools.jib.builder.steps.RegistryCredentialRetriever.getTargetImageCredential (RegistryCredentialRetriever.java:40) at com.google.cloud.tools.jib.builder.steps.AuthenticatePushStep.call (AuthenticatePushStep.java:57) at com.google.cloud.tools.jib.builder.steps.StepsRunner.lambda$authenticateBearerPush$3 (StepsRunner.java:236) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly (TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run (InterruptibleTask.java:69) at com.google.common.util.concurrent.TrustedListenableFutureTask.run (TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624) at java.lang.Thread.run (Thread.java:748) Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden at java.lang.ProcessImpl.create (Native Method) at java.lang.ProcessImpl.<init> (ProcessImpl.java:444) at java.lang.ProcessImpl.start (ProcessImpl.java:139) at java.lang.ProcessBuilder.start (ProcessBuilder.java:1029) at com.google.cloud.tools.jib.registry.credentials.DockerCredentialHelper.retrieve (DockerCredentialHelper.java:132) at com.google.cloud.tools.jib.registry.credentials.DockerCredentialHelper.retrieve (DockerCredentialHelper.java:117) at com.google.cloud.tools.jib.frontend.CredentialRetrieverFactory.retrieveFromDockerCredentialHelper (CredentialRetrieverFactory.java:296) at com.google.cloud.tools.jib.frontend.CredentialRetrieverFactory.lambda$dockerCredentialHelper$1 (CredentialRetrieverFactory.java:141) at com.google.cloud.tools.jib.builder.steps.RegistryCredentialRetriever.retrieve (RegistryCredentialRetriever.java:47) at com.google.cloud.tools.jib.builder.steps.RegistryCredentialRetriever.getTargetImageCredential (RegistryCredentialRetriever.java:40) at com.google.cloud.tools.jib.builder.steps.AuthenticatePushStep.call (AuthenticatePushStep.java:57) at com.google.cloud.tools.jib.builder.steps.StepsRunner.lambda$authenticateBearerPush$3 (StepsRunner.java:236) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly (TrustedListenableFutureTask.java:125) at com.google.common.util.concurrent.InterruptibleTask.run (InterruptibleTask.java:69) at com.google.common.util.concurrent.TrustedListenableFutureTask.run (TrustedListenableFutureTask.java:78) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624) at java.lang.Thread.run (Thread.java:748)

Additional Information: mvn -DskipTests -Denforcer.skip -nsu jib:build -X

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
chanseokohcommented, Aug 12, 2020

@ahoehma Jib Maven 2.5.2 and Jib Gradle 2.5.0 are released with the fix. You will no longer need to explicitly append .exe with 2.5.0.

1reaction
ahoehmacommented, Jun 19, 2020

I’m able to run now my build …

jib:build -Djib.to.credHelper=ecr-login.exe

works for me.

I removed all the auth-stuff from my pom.xml:

<plugin>
          <groupId>com.google.cloud.tools</groupId>
          <artifactId>jib-maven-plugin</artifactId>
          <configuration>
            <!-- <from> -->
            <!-- <image>gcr.io/distroless/java:debug</image> -->
            <!-- </from> -->
            <to>
              <image>${aws.ecr.url}/${finalName}:latest</image>
            </to>
            <container>
              <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
              <ports>
                <port>8080</port>
              </ports>
            </container>
          </configuration>
        </plugin>
Read more comments on GitHub >

github_iconTop Results From Across the Web

docker-credential-ecr-login not installed or not available in ...
The solution was to install docker-credential-ecr-login on my local machine first before using docker-compose .
Read more >
Authenticating Amazon ECR Repositories for Docker CLI with ...
This can be done with a docker login command to authenticate to an ECR registry that provides an authorization token valid for 12...
Read more >
How to add amazon-ecr-credential-helper to path - Server Fault
1 Answer 1 · cd to the cloned folder "amazon-ecr-credential-helper" · run the command on terminal "make docker" · it will create the...
Read more >
Credential helper for AWS ECR docker login not working
... docker-credential-ecr-login binary as described, version 0.4.0, this is in the gitlab-runner user $PATH and it can run from the command ...
Read more >
Authentication methods | Container Registry documentation
Access token: Application Default Credentials provide short-lived access tokens that a ... Log in to gcloud as the user that will run Docker...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found