Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services AWS ElasticBeanstalk从Gitlab注册表中提取Docker映像_Amazon Web Services_Docker_Gitlab_Gitlab Ci_Amazon Elastic Beanstalk - Fatal编程技术网

Amazon web services AWS ElasticBeanstalk从Gitlab注册表中提取Docker映像

Amazon web services AWS ElasticBeanstalk从Gitlab注册表中提取Docker映像,amazon-web-services,docker,gitlab,gitlab-ci,amazon-elastic-beanstalk,Amazon Web Services,Docker,Gitlab,Gitlab Ci,Amazon Elastic Beanstalk,我很难将Docker映像从私有Gitlab注册表拉到AWS多容器ElasticBeanstalk环境 我已将.dockercfg添加到与集群位于同一区域的S3中,并允许aws-elasticbeanstalk-ec2-role IAM role从S3获取数据 ElasticBeanstalk始终返回错误CannotPullContainerError:API错误(500) My.dockercfg的格式如下: { "https://registry.gitlab.com" : {

我很难将Docker映像从私有Gitlab注册表拉到AWS多容器ElasticBeanstalk环境

我已将.dockercfg添加到与集群位于同一区域的S3中,并允许aws-elasticbeanstalk-ec2-role IAM role从S3获取数据

ElasticBeanstalk始终返回错误CannotPullContainerError:API错误(500)

My.dockercfg的格式如下:

{
    "https://registry.gitlab.com" : {
      "auth" : “my gitlab deploy token“,
      "email" : “my gitlab token name“
    }
}
在Dockerrun.aws.json内部,我添加了以下内容

  "authentication": {
    "bucket": "name of my bucket",
    "key": ".dockercfg"
  },

当我尝试通过
docker login-u gitlabtoken name-p token
登录时,它工作得非常好

gitlab部署令牌不是身份验证密钥

要生成正确的身份验证密钥,我通常执行以下操作:

docker run -ti docker:dind sh -c "docker login -u name -p deploy-token registry.gitlab.com && cat /root/.docker/config.json"
它会打印出如下内容:

{
  "auths": {
    "registry.gitlab.com": {
      "auth": "your-auth-key"
    }
  },
  "HttpHeaders": {
    "User-Agent": "Docker-Client/18.09.0 (linux)"
  }
}
然后,根据elasticbeanstalk文档,您应该获取所需的内容

希望这对你有帮助