问题描述
我正在尝试使用码头工具,并获得以下错误: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."
根据,我需要为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
推荐答案
使用,您需要修改 / var / lib / boot2docker / profile
才能添加此变量。
请参阅。
它仍然存在于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.
使用新的,这个想法应该是一样的。
/ var / lib / boot2docker / profile
也存在,如所示。
官方的指向:
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.docker.driver.amd64-linux/etc/docker/daemon.json
这篇关于如何使用Docker for Mac为docker awslogs驱动程序提供凭据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!