docker - 使用通过 Docker 安装的 Jenkins 运行 AWS 命令行界面:找不到命令?
问题描述
从 Jenkins 管道运行时aws
,我收到以下错误消息:command not found
-which aws
返回command not found
.
另一方面,当aws
从单个作业运行时,它可以工作 -which aws
返回/usr/local/bin/aws
。
你知道为什么会这样吗?
谢谢你。
解决方案
您仍然需要在 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
推荐阅读
- pandas - 多个 pandas 数据帧作为多处理的参数
- java - 从不同项目使用时,Jar 文件无法识别 log4j 类
- flutter - 如何有条件地将小部件添加到列表中?
- oracle - Talend 如何使用 Oracle 数据库创建的序列
- database - 如何记录相同关系多次发生的事实(“次数”列与多行)?
- typo3 - TYPO3 流体:f:uri.action 用 & 编码 &
- maven - 构建多个 Maven 模块,然后在 Docker 映像中复制 JAR
- java - JTable ImageIcon 和 String
- linux - 如何在 Docker Container 上配置或更改 eth1 为 eth0
- cron - Chef - 创建一个 cronjob 并使用 Inspec 对其进行测试