Docker Windows: awslogs logging driver - NoCredentialProviders: no valid providers in chain

Hello,

I am using Docker on Windows (Docker Desktop).

I have a docker-compose.yml on which I want to enable awslogs logging driver:

version: "3"
services:
    zookeeper:
        image: confluentinc/cp-zookeeper:6.0.0
        container_name: zookeeper
        hostname: zookeeper
        ports:
          - "2181:2181"
        environment:
            ZOOKEEPER_CLIENT_PORT: 2181
            ZOOKEEPER_TICK_TIME: 2000
            AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
            AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
            AWS_SESSION_TOKEN: ${AWS_SESSION_TOKEN}
        logging:
            driver: awslogs
            options:
                awslogs-region: eu-west-1
                awslogs-group: zookeeper-logs

Under %userprofile%\.aws I have valid, working aws credentials:

/C:\Users\catalin.gavan\.aws
├── config
└── credentials

When I try to build and run the containers, I get the following error:

C:\Users\catalin.gavan\Work\DockerApp>
docker-compose up

Creating network "dockerapp_default" with the default driver
Creating zookeeper ... error                                                                                                                                                              
ERROR: for zookeeper  Cannot start service zookeeper: failed to initialize logging driver: failed to create Cloudwatch log stream: NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors

ERROR: for zookeeper  Cannot start service zookeeper: failed to initialize logging driver: failed to create Cloudwatch log stream: NoCredentialProviders: no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors
ERROR: Encountered errors while bringing up the project.

The CloudWatch zookeeper-logs logs group already exists. The AWS profile which I am using has full access, and has already been tested with different scenarios.

The problem seems to be caused by Docker Desktop (Windows) daemon, which cannot read the .aws credentials.

The same problem has been reported:

Thank you