Py学习  »  Git

gitlab容器扫描程序无法安装aws cli

Evan R. • 4 年前 • 2167 次点击  

在gitlab CI文档中( https://docs.gitlab.com/ee/user/application_security/container_scanning/ ),说明可以使用以下方法扫描ECR:

container_scanning:
  before_script:
    - ruby -r open-uri -e "IO.copy_stream(URI.open('https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip'), 'awscliv2.zip')"
    - unzip awscliv2.zip
    - ./aws/install
    - aws --version
    - export AWS_ECR_PASSWORD=$(aws ecr get-login-password --region region)

include:
  - template: Security/Container-Scanning.gitlab-ci.yml
    DOCKER_IMAGE: <aws_account_id>.dkr.ecr.<region>.amazonaws.com/<image>:<tag>
    DOCKER_USER: AWS
    DOCKER_PASSWORD: "$AWS_ECR_PASSWORD"

当我添加“before_脚本”时,我得到以下结果:

inflating: aws/dist/cryptography-3.3.2-py3.9.egg-info/LICENSE  
  inflating: aws/dist/cryptography-3.3.2-py3.9.egg-info/WHEEL  
   creating: aws/dist/cryptography/hazmat/
   creating: aws/dist/cryptography/hazmat/bindings/
  inflating: aws/dist/cryptography/hazmat/bindings/_openssl.abi3.so  
$ ./aws/install
mkdir: cannot create directory ‘/usr/local/aws-cli’: Permission denied
Uploading artifacts for failed job
00:00
Uploading artifacts...
WARNING: gl-container-scanning-report.json: no matching files 

似乎它没有权限。有没有别的办法让它发挥作用?谢谢

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/132602
文章 [ 1 ]  |  最新文章 4 年前