Cannot run program "docker-credential-ecr-login.cmd"
See original GitHub issueEnvironment: 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:
- installed docker-credential-ecr-login with “go get -u github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login”
- add jib-maven-plugin
- 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:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
@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.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: