'dockerBuildImage' task requires ECR credentials

Create issue
Issue #24 new
Former user created an issue

Before applying the plugin, my team used dockerBuildImage task to build the image for local testing. After configuring deployment to ECR, this task suddenly starts to know about ECR and fails with

$ ./gradlew dockerBuildImage
> Task :populateECRCredentials FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':populateECRCredentials'.
> Unable to load AWS credentials from any provider in the chain: [EnvironmentVariableCredentialsProvider: Unable to load AWS credentials from environment variables (AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY)), SystemPropertiesCredentialsProvider: Unable to load AWS credentials from Java system properties (aws.accessKeyId and aws.secretKey), WebIdentityTokenCredentialsProvider: To use assume role profiles the aws-java-sdk-sts module must be on the class path., com.amazonaws.auth.profile.ProfileCredentialsProvider@30b4e66b: profile file cannot be null, com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper@f7229e3: Failed to connect to service endpoint: ]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.6.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 4s                                                                                                                                                      

In my opinion it shouldn't - it's just about building the image, not pushing it to ECR. There are other tasks responsible for pushing. During building, everything apart from downloading needed Docker layers should happen locally.

A workaround is to comment out the plugin usage, then it works as before.

Best, Piotr

Comments (0)

  1. Log in to comment