private AuthConfig getAuthConfigFromTaskRole() throws IOException {
        log.debug("No user and password set for ECR, checking ECS Task role");
        URI uri = getMetadataEndpointForCredentials();
        if (uri == null) {
            return null;
        }
        // get temporary credentials
        log.debug("Getting temporary security credentials from: %s", uri);
        try (CloseableHttpClient client = HttpClients.custom().useSystemProperties().build()) {
            RequestConfig conf =
                RequestConfig.custom().setConnectionRequestTimeout(1000).setConnectTimeout(1000)
                    .setSocketTimeout(1000).build();
            HttpGet request = new HttpGet(uri);
            request.setConfig(conf);
            return readAwsCredentials(client, request);
        }
    }
Try using the AWS credentials provided via ENV variables.
See https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html
src/main/java/io/fabric8/maven/docker/util/AuthConfigFactory.java