首页 > 解决方案 > 如何在我的 PATH 中设置 docker-credential-ecr-login 在 GitLab CI 中的任何其他内容之前

问题描述

我正在使用 AWS ECR 托管私有 Dockerfile 映像,并且我想在 GitLab CI 中使用它。

根据文档,我需要设置 docker-credential-ecr-login 来获取私有图像,但我不知道如何做。那是我的 .gitlab-ci 文件:

image: 0222822883.dkr.ecr.us-east-1.amazonaws.com/api-build:latest

tests:
  stage: test
  before_script:
    - echo "before_script"
    - apt install amazon-ecr-credential-helper
    - apk add --no-cache curl jq python py-pip
    - pip install awscli
  script:
    - echo "script"
    - bundle install
    - bundle exec rspec
  allow_failure: true # for now as we do not have tests

谢谢你。

标签: dockergitlabaws-ecr

解决方案



推荐阅读