jib icon indicating copy to clipboard operation
jib copied to clipboard

The system does not have docker-credential-ecr-login CLI

Open jimmyzzxhlh opened this issue 2 years ago • 4 comments

Environment:

  • Jib version: 3.4.0
  • Build tool: Gradle 8.5.0
  • OS: Mac Ventura 13.5 (22G74)

Description of the issue: I have the AWS docker-credential-ecr-login installed using Brew, and I can execute the following command to get a secret token.

echo <repository_uri> | docker-credential-ecr-login get

But Jib throws the following error:

Execution failed for task ':jib'.
> com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: The system does not have docker-credential-ecr-login CLI

Steps to reproduce: Run ./gradlew jib

jib-gradle-plugin Configuration:

jib {
	from {
		image = "openjdk:alpine"
	}
	to {
		image = <repository_uri>
		setCredHelper("ecr-login")
		tags = setOf("latest")
	}
}

jimmyzzxhlh avatar Jan 28 '24 00:01 jimmyzzxhlh

I suspect this:

You configured a credential helper, but the helper is not on $PATH. This is especially common when running Jib inside IDE where the IDE binary is launched directly from an OS menu and does not have access to your shell's environment.

If everything else fails, as a last resort, you can always set the absolute path of your docker-credential-ecr-login:

This parameter can either be configured as an absolute path to the credential helper executable or as a credential helper suffix (following docker-credential-).

chanseokoh avatar Jan 28 '24 23:01 chanseokoh

I have this same problem on OSX, but it's with desktop and osxkeychain

jasonab avatar Apr 04 '24 20:04 jasonab

Same issue here.

Jib version: 3.4.3 Gradle Wrapper: 8.6 OS: Mac Sonoma 14.5 (23F79)

Setting credHelper as absolute path works, but It is annoying to manage differences with the CI/CD environment.

39otrebla avatar Jun 15 '24 12:06 39otrebla