如何使用Docker for Mac为docker awslogs驱动程序提供凭据? [英] How do I provide credentials to the docker awslogs driver using Docker for Mac?

查看:718
本文介绍了如何使用Docker for Mac为docker awslogs驱动程序提供凭据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用码头工具 awslogs驱动程序,并获得以下错误:docker :守护进程错误响应:无法初始化日志记录驱动程序:NoCredentialProviders:链中没有有效提供程序已弃用

I'm trying to use the docker awslogs driver and getting the following error: "docker: Error response from daemon: Failed to initialize logging driver: NoCredentialProviders: no valid providers in chain. Deprecated."

根据这个GitHub评论,我需要为docker守护程序设置AWS_SHARED_CREDENTIALS_FILE环境变量,但是我不知道如何使用Docker对于Mac。

According to this GitHub comment, I need to set the AWS_SHARED_CREDENTIALS_FILE environment variable for the docker daemon, but I'm not sure how to do that when using Docker for Mac.

我用于启动容器的命令是:

The command I'm using to start the container is:

docker run -d \
 --log-driver=awslogs \
 --log-opt awslogs-region=us-east-1 \
 --log-opt awslogs-group=my-log-group \
 my-image

版本信息:


  • Docker for Mac 1.12.1-rc1-beta23 build 11375

  • 卡皮坦10 .11.6

推荐答案


但我不知道如何使用Docker for Mac时,请执行此操作。

but I'm not sure how to do that when using Docker for Mac.

使用 boot2docker ,您需要修改 / var / lib / boot2docker / profile 才能添加此变量。

请参阅 boot2docker上的Docker守护程序配置文件

它仍然存在于TinyCore基于虚拟机的虚拟机重新启动,然后docker守护程序将考虑到它。

With boot2docker, you would need to modify /var/lib/boot2docker/profile in order to add this variable.
See "Docker daemon config file on boot2docker".
It does persists across the TinyCore-based VM reboot, and the docker daemon would then take it into account.

使用新的 Docker for Mac xhyve-based ,这个想法应该是一样的。

/ var / lib / boot2docker / profile 也存在,如此答案所示。

官方的 docker dameon doc 指向:

With the new docker for Mac xhyve-based, the idea should be the same.
/var/lib/boot2docker/profile does exist as well, as shown in this answer.
The official docker dameon doc points to:

--config-file=/etc/docker/daemon.json  Daemon configuration file

所以尝试修改这个文件

默认情况下,评论提及:

By default, the comments mention:

~/Library/Containers/com.docker.docker/Data/database/com.doc‌​ker.driver.amd64-lin‌​ux/etc/docker/daemon‌​.json

这篇关于如何使用Docker for Mac为docker awslogs驱动程序提供凭据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆