Unable to copy files from local to docker container

I want to pass the content of some file to my docker image, basically the .aws credential and other file. Is there a way out?

Please find the code as below:

docker build -t TestImage . --build-arg AWSPathConfig=/home/ubuntu/.aws/config --build-arg AWSPathCredential=/home/ubuntu/.aws/credentials --no-cache=true

here AWSPathConfig and AWSPathCredential are the aws config and credential content

Right now they are just strings that happen to match filenames on your host.

Secrets should never, never, never ever be build into an image. Neither for an artifact repo, nor for a cli tool like aws cli or kubectl… never ever.