[英]Docker - Error: Cannot perform an interactive login from a non TTY device (GCP Service Account)
The command docker login -u _json_key --password-stdin https://gcr.io < ~/service-account.json
works locally, but when I try to run it in a CI environment like Github Actions, I get the following error. The command docker login -u _json_key --password-stdin https://gcr.io < ~/service-account.json
works locally, but when I try to run it in a CI environment like Github Actions, I get the following error .
Error: Cannot perform an interactive login from a non TTY device错误:无法从非 TTY 设备执行交互式登录
##[error]Process completed with exit code 1. ##[错误]进程完成,退出代码为 1。
The oauth2accesstoken
authentication strategy worked for me. oauth2accesstoken
身份验证策略对我有用。
gcloud
cli using service account使用服务帐号登录gcloud
cli gcloud auth activate-service-account --key-file=${HOME}/service-account.json
gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://gcr.io
It seems you are impersonating a service account with an authentication token to login docker.您似乎正在使用身份验证令牌模拟服务帐户来登录 docker。 You can obtain an access token for the service account.您可以获得服务帐户的访问令牌。 Since the token is short-lived, request it less than an hour before you use it to connect with the Container Registry.由于令牌是短暂的,请在使用它连接 Container Registry 前不到一小时请求它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.