private URI getMetadataEndpointForCredentials() {
        // get ECS task role - if available
        String awsContainerCredentialsUri = System.getenv("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI");
        if (awsContainerCredentialsUri == null) {
            log.debug("System environment not set for variable AWS_CONTAINER_CREDENTIALS_RELATIVE_URI, no task role found");
            return null;
        }
        if (awsContainerCredentialsUri.charAt(0) != '/') {
            awsContainerCredentialsUri = "/" + awsContainerCredentialsUri;
        }

        String ecsMetadataEndpoint = System.getenv("ECS_METADATA_ENDPOINT");
        if (ecsMetadataEndpoint == null) {
            ecsMetadataEndpoint = "http://169.254.170.2";
        }

        try {
            return new URI(ecsMetadataEndpoint + awsContainerCredentialsUri);
        } catch (URISyntaxException e) {
            log.warn("Failed to construct path to ECS metadata endpoint for credentials", e);
            return null;
        }
    }
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