从ECR获取Concourse Docker资源



我正在尝试使用存储在AWS EC2容器服务存储库(ECR)中的Docker资源。配置看起来像:

- name: my-docker-resource
  type: docker-image
  source:
    repository: account-id.dkr.ecr.eu-west-1.amazonaws.com/my-repo
    tag: d196e5688d
    aws_access_key_id: ((docker-aws-access-key-id))
    aws_secrey_access_key: ((docker-aws-secret-access-key))

当我运行在此资源上执行get的管道时,我会看到"无版本可用"。

我试图验证我正在使用的凭据可以访问回购:

$(aws ecr get-login --no-include-email --profile concourse)
You must specify a region. You can also configure your region by running "aws configure".

所以问题1:如何告诉资源使用哪个区域?它可以从仓库中猜出吗?如果该地区似乎表明凭据具有足够的特权:

$(aws ecr get-login --no-include-email --profile concourse --region eu-west-1)
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded

我然后尝试拉出回购。在我的机器(TM)上工作。管道仍然说"没有可用版本"。

我在某个地方阅读了自定义存储库需要明确说明端口,因此我也尝试了account-id.dkr.ecr.eu-west-1.amazonaws.com:5000,但无济于事。在标签中使用的也不在本地工作。

任何指针?

弹出两件事:

  • Concourse Docker Image Resources经历了许多更改,某些版本不适合ECR。与您的大厅捆绑在一起的docker-image的版本可能已经过时了。您可以通过声明自定义资源类型来引用最新版本:

resource_types:
  # Override the built-in docker-image to get a recent version
  - name: latest-docker-image
    type: docker-image
    source:
      repository: concourse/docker-image-resource
      tag: latest
resources:
  - name: my-docker-resource
    type: latest-docker-image

  • The port is required, and it's usually 443. Try:

- name: my-docker-resource
  type: docker-image
  source:
    repository: account-id.dkr.ecr.eu-west-1.amazonaws.com:443/my-repo
    tag: d196e5688d
    aws_access_key_id: ((docker-aws-access-key-id))
    aws_secrey_access_key: ((docker-aws-secret-access-key))

This is working now, although I couldn't really tell you what was the source of "not working" and "working". My current configuration:

- name: ecr-repository
  type: docker-image
  source:
    repository: ((account_id)).dkr.ecr.eu-west-1.amazonaws.com/myapp
    aws_access_key_id: ((aws_access_key_id))
    aws_secret_access_key: ((aws_secret_access_key))

基本上与我开始的相同。我要么用证书或其他上下文搞砸了,要么像菲利普所建议的那样对自己的时机(关于码头资源图像)不幸。

最新更新