[GH-ISSUE #1799] gcloud cli not installed on act image #877

Closed
opened 2026-03-01 21:47:06 +03:00 by kerem · 1 comment
Owner

Originally created by @mcascone on GitHub (May 11, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1799

Bug report info

act --bug-report
act version:            0.2.45
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 10
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
	/var/run/docker.sock
	$HOME/.colima/docker.sock
	$HOME/.docker/run/docker.sock
Config files:           
	/Users/maximiliancascone/.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.20.3
	Module path:           command-line-arguments
	Main version:          
	Main path:             
	Main checksum:         
	Build settings:
		-buildmode:           exe
		-compiler:            gc
		-ldflags:             -X main.version=0.2.45
		CGO_ENABLED:          1
		CGO_CFLAGS:           
		CGO_CPPFLAGS:         
		CGO_CXXFLAGS:         
		CGO_LDFLAGS:          
		GOARCH:               arm64
		GOOS:                 darwin
Docker Engine:
	Engine version:        20.10.24
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         cgroupfs
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Docker Desktop
	OS type:               linux
	OS version:            
	OS arch:               aarch64
	OS kernel:             5.15.49-linuxkit
	OS CPU:                5
	OS memory:             7851 MB
	Security options:
		name=seccomp,profile=default
		name=cgroupns

Command used with act

act --rm

Describe issue

The Google SDK CLI is installed by default on the default ubuntu GitHub runner image, but is not available on the Act runner.
I pulled latest and am using the latest version of act.

Please add the Google Cloud CLI to the base Act image.

Bonus points for including the CLIs for AWS and Azure.

WORKAROUND

I was able to build a custom ACT image to install the Google CLI with this Dockerfile:

FROM catthehacker/ubuntu:act-latest

RUN apt update && apt install -y

RUN apt-get install apt-transport-https ca-certificates gnupg
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

RUN apt-get update && apt-get install google-cloud-cli

It may not be the most perfectly written Dockerfile ever but it works for the moment.

Next: Delete the existing catthehacker/ubuntu:act-latest image, and tag my newly built image with that same tag:

docker image rm catthehacker/ubuntu:act-latest
docker tag <the sha of the image just built>  catthehacker/ubuntu:act-latest

Finally, run act with force-pull disabled:

act -p=false

This runs Act with the local image, and my google-cloud commands work!

No response

Workflow content

name: Bucket Deploy
on: workflow_dispatch
#   push:
#     branches: [ main ]

jobs:
  Bucket-Deploy:
    runs-on: 'ubuntu-latest'
    steps:
      - id: 'deploy'
        uses: 'bitovi/github-actions-gcp-bucket@DEVOPS-767-no-clobber'
        with:
          gcp_access_key: ${{ secrets.GOOGLE_CREDENTIALS }}
          bucket_name: ${{ env.BUCKET_NAME }}
          file_name: ${{ env.FILE_NAME }}

Relevant log output

[Bucket Deploy/Bucket-Deploy] ⭐ Run Main Deploy the File
[Bucket Deploy/Bucket-Deploy]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/deploy-composite-deploy.sh] user= workdir=
| Uploading your file!
| /var/run/act/actions/bitovi-github-actions-gcp-bucket@DEVOPS-767-no-clobber/scripts/bucket_helpers.sh: line 29: gcloud: command not found
| /var/run/act/actions/bitovi-github-actions-gcp-bucket@DEVOPS-767-no-clobber/scripts/bucket_helpers.sh: line 9: gcloud: command not found

Additional information

I will be taking a look at contributing a PR with the dockerfile changes, but i haven't looked at how complicated that might be yet.

Originally created by @mcascone on GitHub (May 11, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1799 ### Bug report info ```plain text act --bug-report act version: 0.2.45 GOOS: darwin GOARCH: arm64 NumCPU: 10 Docker host: DOCKER_HOST environment variable is not set Sockets found: /var/run/docker.sock $HOME/.colima/docker.sock $HOME/.docker/run/docker.sock Config files: /Users/maximiliancascone/.actrc: -P ubuntu-latest=catthehacker/ubuntu:act-latest -P ubuntu-22.04=catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 Build info: Go version: go1.20.3 Module path: command-line-arguments Main version: Main path: Main checksum: Build settings: -buildmode: exe -compiler: gc -ldflags: -X main.version=0.2.45 CGO_ENABLED: 1 CGO_CFLAGS: CGO_CPPFLAGS: CGO_CXXFLAGS: CGO_LDFLAGS: GOARCH: arm64 GOOS: darwin Docker Engine: Engine version: 20.10.24 Engine runtime: runc Cgroup version: 2 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Docker Desktop OS type: linux OS version: OS arch: aarch64 OS kernel: 5.15.49-linuxkit OS CPU: 5 OS memory: 7851 MB Security options: name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh act --rm ``` ### Describe issue The Google SDK CLI is installed by default on the default ubuntu GitHub runner image, but is not available on the Act runner. I pulled `latest` and am using the latest version of `act`. Please add the Google Cloud CLI to the base Act image. Bonus points for including the CLIs for AWS and Azure. ## WORKAROUND I was able to build a custom ACT image to install the Google CLI with this Dockerfile: ```dockerfile FROM catthehacker/ubuntu:act-latest RUN apt update && apt install -y RUN apt-get install apt-transport-https ca-certificates gnupg RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - RUN apt-get update && apt-get install google-cloud-cli ``` It may not be the most perfectly written Dockerfile ever but it works for the moment. Next: Delete the existing `catthehacker/ubuntu:act-latest` image, and tag my newly built image with that same tag: ```sh docker image rm catthehacker/ubuntu:act-latest docker tag <the sha of the image just built> catthehacker/ubuntu:act-latest ``` Finally, run `act` with `force-pull` disabled: ```sh act -p=false ``` This runs Act with the local image, and my google-cloud commands work! ### Link to GitHub repository _No response_ ### Workflow content ```yml name: Bucket Deploy on: workflow_dispatch # push: # branches: [ main ] jobs: Bucket-Deploy: runs-on: 'ubuntu-latest' steps: - id: 'deploy' uses: 'bitovi/github-actions-gcp-bucket@DEVOPS-767-no-clobber' with: gcp_access_key: ${{ secrets.GOOGLE_CREDENTIALS }} bucket_name: ${{ env.BUCKET_NAME }} file_name: ${{ env.FILE_NAME }} ``` ### Relevant log output ```sh [Bucket Deploy/Bucket-Deploy] ⭐ Run Main Deploy the File [Bucket Deploy/Bucket-Deploy] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/deploy-composite-deploy.sh] user= workdir= | Uploading your file! | /var/run/act/actions/bitovi-github-actions-gcp-bucket@DEVOPS-767-no-clobber/scripts/bucket_helpers.sh: line 29: gcloud: command not found | /var/run/act/actions/bitovi-github-actions-gcp-bucket@DEVOPS-767-no-clobber/scripts/bucket_helpers.sh: line 9: gcloud: command not found ``` ### Additional information I will be taking a look at contributing a PR with the dockerfile changes, but i haven't looked at how complicated that might be yet.
kerem 2026-03-01 21:47:06 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 8, 2023):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:1800631972 --> @github-actions[bot] commented on GitHub (Nov 8, 2023): Issue is stale and will be closed in 14 days unless there is new activity
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#877
No description provided.