[英]jenkins docker on aws
我正在從ec2映像運行jenkins並構建一個docker映像以推送到ecr
我不斷收到這個錯誤
Running shell script
+ aws ecr get-login --no-include-email --region us-east-2
Unable to locate credentials. You can configure credentials by running "aws configure".
我試圖創建憑證文件,即
touch ~/.aws/credentials and echo >> to the file
我嘗試過
--build-arg AWS_ACCESS_KEY_ID=xxxxxxx
並且我也將我的憑證添加到詹金斯
請任何幫助將不勝感激
您可以通過由jenkins用戶配置aws cli來解決此問題。 只需以jenkins用戶身份啟動此命令,並提及您的訪問密鑰和秘密密鑰以及AWS區域。
首次更改為Jenkins用戶
[root@symphony ~]# su -s /bin/bash jenkins
然后配置AWS CLI
[jenkins@symphony ~]$ aws configure
AWS Access Key ID [None]: xxxxxxxxxxxxxxxx
AWS Secret Access Key [None]: yyyyyyyyyyyy
Default region name [None]: us-east-2
Default output format [None]:
使用此命令驗證aws cli
[jenkins@symphony ~]$ aws ecr get-login --no-include-email --region us-east-2
注意:確保您的用戶有權訪問ECR和ECS。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.