Configuration file not found in directory "/" serverless config credentials --provider aws

problem when I use

RUN yarn global add serverless
RUN serverless config credentials --provider aws --key “your-key” --secret “your-secret”

in my dockerfile
with the new version 4.0.35
gives the problem

RUN serverless config credentials --provider aws --key “your-key” --secret “your-secret”:
#0 13.06
#0 13.62
#0 13.62 :heavy_multiplication_x: Configuration file not found in directory “/”
#0 13.62

failed to solve: executor failed running [/bin/sh -c serverless config credentials --provider aws --key ${awsKey} --secret ${awsSecret}]: exit code: 1

My solution was to work with an older version.
RUN yarn global add serverless@3.39.0

Hi there. There really is no need to run the command. You can just add that key and secret as environment variables or within the ~/.aws/credentials file: Environment variables to configure the AWS CLI - AWS Command Line Interface