[GH-ISSUE #642] Enhancement: aws CLI #418

Closed
opened 2026-03-01 21:43:12 +03:00 by kerem · 8 comments
Owner

Originally created by @Steph0 on GitHub (Apr 28, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/642

Describe feature

Hey there. First thanks for all the great work you do.

I stumbled upong something while using act. I am using the docker image nektos/act-environments-ubuntu:18.04 which really helps testing my workflows.
But the AWS CLI included in this env is aws-cli/1.18.2 Python/2.7.17 Linux/5.8.0-50-generic botocore/1.15.2 while the one used by github has one major more: AWS CLI version aws-cli/2.1.38 Python/3.8.8 Linux/5.4.0-1046-azure exe/x86_64.ubuntu.20 prompt/off.

This prevent testing AWS execution like

aws lambda invoke \
                --cli-binary-format raw-in-base64-out \
                --function-name ${function} \
                --payload "${lambda_payload}" \
                response.json

In ACT the --cli-binary-format raw-in-base64-out is rejected, while if you don't put this argument, your Github Actions fails because in AWS CLI 2+ it is necessary (defaults to base64).

Thought it would be nice to raise an enhancement request here about it.

Originally created by @Steph0 on GitHub (Apr 28, 2021). Original GitHub issue: https://github.com/nektos/act/issues/642 ## Describe feature Hey there. First thanks for all the great work you do. I stumbled upong something while using act. I am using the docker image `nektos/act-environments-ubuntu:18.04` which really helps testing my workflows. But the AWS CLI included in this env is `aws-cli/1.18.2 Python/2.7.17 Linux/5.8.0-50-generic botocore/1.15.2` while the one used by github has one major more: `AWS CLI version aws-cli/2.1.38 Python/3.8.8 Linux/5.4.0-1046-azure exe/x86_64.ubuntu.20 prompt/off`. This prevent testing AWS execution like ``` aws lambda invoke \ --cli-binary-format raw-in-base64-out \ --function-name ${function} \ --payload "${lambda_payload}" \ response.json ``` In ACT the `--cli-binary-format raw-in-base64-out ` is rejected, while if you don't put this argument, your Github Actions fails because in AWS CLI 2+ it is necessary (defaults to base64). Thought it would be nice to raise an enhancement request here about it.
kerem 2026-03-01 21:43:12 +03:00
Author
Owner

@catthehacker commented on GitHub (Apr 28, 2021):

That's because the image is outdated (last push was February 2020). Issue should be raised in https://github.com/nektos/act-environments.

<!-- gh-comment-id:828449638 --> @catthehacker commented on GitHub (Apr 28, 2021): That's because the image is outdated (last push was February 2020). Issue should be raised in https://github.com/nektos/act-environments.
Author
Owner

@Steph0 commented on GitHub (Apr 28, 2021):

Will do that thanks

<!-- gh-comment-id:828451360 --> @Steph0 commented on GitHub (Apr 28, 2021): Will do that thanks
Author
Owner

@catthehacker commented on GitHub (Apr 28, 2021):

@Steph0 Alternatively you can try using catthehacker/ubuntu:full-20.04 image which is from 4-5 months ago

❯❯❯ docker run --rm -ti catthehacker/ubuntu:full-20.04
runner@a80cdad2c819:~$ aws --version
aws-cli/2.1.10 Python/3.7.3 Linux/5.12.0-rc7-next-20210416-microsoft-cbl exe/x86_64.ubuntu.20 prompt/off
runner@a80cdad2c819:~$
<!-- gh-comment-id:828451596 --> @catthehacker commented on GitHub (Apr 28, 2021): @Steph0 Alternatively you can try using `catthehacker/ubuntu:full-20.04` image which is from 4-5 months ago ``` ❯❯❯ docker run --rm -ti catthehacker/ubuntu:full-20.04 runner@a80cdad2c819:~$ aws --version aws-cli/2.1.10 Python/3.7.3 Linux/5.12.0-rc7-next-20210416-microsoft-cbl exe/x86_64.ubuntu.20 prompt/off runner@a80cdad2c819:~$ ```
Author
Owner

@catthehacker commented on GitHub (Apr 28, 2021):

Related: #630

<!-- gh-comment-id:828452569 --> @catthehacker commented on GitHub (Apr 28, 2021): Related: #630
Author
Owner

@Steph0 commented on GitHub (Apr 28, 2021):

Thanks a lot @catthehacker I'm gonna test that!

<!-- gh-comment-id:828469651 --> @Steph0 commented on GitHub (Apr 28, 2021): Thanks a lot @catthehacker I'm gonna test that!
Author
Owner

@robotrapta commented on GitHub (Apr 28, 2022):

Thanks @catthehacker for the fix. But I gotta say at 61 GB that is legitimately the largest docker image I've ever seen! By the number of layers it looks like maybe it's been iteratively maintained?

Anything smaller you'd recommend?

<!-- gh-comment-id:1112647760 --> @robotrapta commented on GitHub (Apr 28, 2022): Thanks @catthehacker for the fix. But I gotta say at 61 GB that is legitimately the largest docker image I've ever seen! By the number of layers it looks like maybe it's been iteratively maintained? Anything smaller you'd recommend?
Author
Owner

@catthehacker commented on GitHub (Apr 30, 2022):

I've made (in my opinion) easy to modify image templates (https://github.com/catthehacker/docker-images) that you could extend. It's mostly made for GitHub Actions, but you can build them locally with script in repo

<!-- gh-comment-id:1114008040 --> @catthehacker commented on GitHub (Apr 30, 2022): I've made (in my opinion) easy to modify image templates (https://github.com/catthehacker/docker-images) that you could extend. It's mostly made for GitHub Actions, but you can build them locally with script in repo
Author
Owner

@helloint commented on GitHub (Apr 10, 2024):

For those come here because of using the default act medium image catthehacker/ubuntu that doesn't contains aws cli, here is my solution:

  1. Prepare a Dockerfile
FROM catthehacker/ubuntu:act-latest
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
    apt-get install -y awscli

RUN aws --version

WORKDIR /app

CMD ["/bin/bash"]

The image size is around 1.43GB.

You can also base on latest ubuntu:latest

# 使用最新的 Ubuntu 镜像作为基础
FROM ubuntu:latest
ARG DEBIAN_FRONTEND=noninteractive

# 更新系统并安装 AWS CLI
RUN apt-get update && \
    apt-get install -y awscli nodejs npm

# 验证 AWS CLI 是否安装成功
RUN aws --version

# 验证 Node.js 安装
RUN node -v && npm -v

# 设定默认的工作目录
WORKDIR /app

# 可选:将本地文件复制到容器中,如果有需要可以添加你的文件拷贝指令

# 定义默认的容器启动命令(例如可以启动一个交互式的 shell)
CMD ["/bin/bash"]

The size is around 1.79GB

  1. Build your image.
docker build -t ubuntu-aws .
act -P ubuntu-latest=ubuntu-aws --pull=false -W ./.github/workflows/test-aws.yml 
  1. In case anything else missing, you can add it into the Dockerfile.

My use case is simple, just need to upload files to AWS S3, so the above works for me.

Thanks.

<!-- gh-comment-id:2046803523 --> @helloint commented on GitHub (Apr 10, 2024): For those come here because of using the default act medium image `catthehacker/ubuntu` that doesn't contains aws cli, here is my solution: 1. Prepare a `Dockerfile` ``` FROM catthehacker/ubuntu:act-latest ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -y awscli RUN aws --version WORKDIR /app CMD ["/bin/bash"] ``` The image size is around 1.43GB. You can also base on latest `ubuntu:latest` ``` # 使用最新的 Ubuntu 镜像作为基础 FROM ubuntu:latest ARG DEBIAN_FRONTEND=noninteractive # 更新系统并安装 AWS CLI RUN apt-get update && \ apt-get install -y awscli nodejs npm # 验证 AWS CLI 是否安装成功 RUN aws --version # 验证 Node.js 安装 RUN node -v && npm -v # 设定默认的工作目录 WORKDIR /app # 可选:将本地文件复制到容器中,如果有需要可以添加你的文件拷贝指令 # 定义默认的容器启动命令(例如可以启动一个交互式的 shell) CMD ["/bin/bash"] ``` The size is around 1.79GB 2. Build your image. ```shell docker build -t ubuntu-aws . act -P ubuntu-latest=ubuntu-aws --pull=false -W ./.github/workflows/test-aws.yml ``` 3. In case anything else missing, you can add it into the Dockerfile. My use case is simple, just need to upload files to AWS S3, so the above works for me. Thanks.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#418
No description provided.