Docker Community Forums

Share and learn in the Docker community.

How to set environment variables for docker daemon on Debian linux?

Can someone please advise how to pass the environment variable to docker daemon? I’m trying to setup the AWS logging driver and I need to pass the access key and the secret key. I tried to setup following in the “/etc/default/docker” file and restarting the docker

export AWS_REGION=***
export AWS_ACCESS_KEY_ID=****

But I keep getting the error “Failed to initialize logging driver: failed to create Cloudwatch log stream: NoCredentialProviders: no valid providers in chain”

I also don’t see the option to pass the environment variables in “daemon.json” file too. I can’t use AWS EC2 IAM profile because my host is not in AWS.

Solution documented here: Pass Credentials to the awslogs Docker Logging Driver on Ubuntu · Wouter Dullaert works for me.