moby: Missing documentation: awslogs doesn't support AWS credentials files contrary to documentation

It looks like awslogs doesn’t support AWS credentials files contrary to documentation. The documentation says

You can provide these credentials with the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN environment variables, the default AWS shared credentials file (~/.aws/credentials of the root user)

First of all providing environment variables and credentials file is redundant because it caries same information. Secondly, hours of debugging indicate that Docker doesn’t open /root/.aws/credentials at all which was verified with watching file events using fatrace.

As result docker run always fails with

Error response from daemon: Cannot start container case: Failed to initialize logging driver: NoCredentialProviders: no valid providers in chain

In order to make sure it’s not me going crazy I wrote following simple application in Scala to doublecheck that AWS SDK does indeed works with credentials file

val conf = ConfigFactory.load().getConfig("case")
val aws_region = RegionUtils.getRegion(conf.getString("aws_region"))
val client = new AWSLogsClient(new ProfileCredentialsProvider("default"))
client.setRegion(aws_region)
val req = new PutLogEventsRequest()
req.setLogGroupName("case")
req.setLogStreamName("api-server")
val arr: util.Collection[InputLogEvent] = new util.ArrayList[InputLogEvent]()
val event = new InputLogEvent()
event.setMessage("test message!")
event.setTimestamp(ZonedDateTime.now().toEpochSecond * 1000)
arr.add(event)
req.setLogEvents(arr)
val regs = client.putLogEvents(req)
println(regs)

Could you confirm that support of credentials file was removed in 1.9.1 or explain how to make it work ?

Thanks!


Containers: 6 Images: 83 Server Version: 1.9.1 Storage Driver: aufs Root Dir: /var/lib/docker/aufs Backing Filesystem: extfs Dirs: 95 Dirperm1 Supported: true Execution Driver: native-0.2 Logging Driver: json-file Kernel Version: 4.2.0-23-generic Operating System: Ubuntu 15.10 CPUs: 8 Total Memory: 15.61 GiB Name: expert-x220 ID: 3CN5:AOOV:DKXE:5WUH:HFTZ:2744:MU7U:REWH:LFPQ:M5K4:3SM5:WMXA Username: expert Registry: https://index.docker.io/v1/ WARNING: No swap limit support

Client: Version: 1.9.1 API version: 1.21 Go version: go1.4.2 Git commit: a34a1d5 Built: Fri Nov 20 13:20:08 UTC 2015 OS/Arch: linux/amd64

Server: Version: 1.9.1 API version: 1.21 Go version: go1.4.2 Git commit: a34a1d5 Built: Fri Nov 20 13:20:08 UTC 2015 OS/Arch: linux/amd64

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

Is there a way to set this environment variable for the docker daemon when using Docker for Mac?