首页 > 解决方案 > 使用通过 Docker 安装的 Jenkins 运行 AWS 命令​​行界面:找不到命令?

问题描述

从 Jenkins 管道运行时aws,我收到以下错误消息:command not found-which aws返回command not found.

另一方面,当aws从单个作业运行时,它可以工作 -which aws返回/usr/local/bin/aws

你知道为什么会这样吗?

谢谢你。

标签: dockerjenkinsaws-cli

解决方案


您仍然需要在 docker 容器内安装 AWS CLI。

 # Swap to root user to install pip and aws cli then go back to jenkins user
USER root
RUN apt-get update
RUN apt install python3-pip -y
RUN pip3 install awscli --upgrade
USER jenkins


推荐阅读