Skip to content

fyndiq/circleci-node-gcloudsdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCI Node Google Cloud SDK

Docker image that extends the cimg/node image with Google's Cloud SDK and additional tools for CI/CD pipelines.

Current Version

  • Node.js: 22.19.0 (pinned to specific version)
  • Google Cloud SDK: 538.0.0
  • Additional Tools: kubectl, Helm (v3.4.2), Skaffold (v1.17.2), jq

Quick Start

# Use in your CircleCI config
docker: fyndiq/circleci-node-gcloudsdk:node-lts-gcloudsdk538.0.0-v1

Building and Testing

Architecture Requirements

Important: This image must be built for linux/amd64 architecture to be compatible with CircleCI runners.

Build the Image

# Build for production (amd64 - CircleCI compatible)
make build

# Build for local testing (native architecture)
make build-local

Test the Image

Run the comprehensive test suite to verify all tools work correctly:

./test-image.sh

The test script will verify:

  • ✅ Node.js version and npm
  • ✅ Google Cloud SDK functionality
  • ✅ kubectl, Helm, Skaffold, and jq tools
  • ✅ CircleCI user setup and sudo access

Push to Registry

# Builds for amd64 and pushes directly
make push

Note: make push automatically builds for linux/amd64 and pushes to ensure CircleCI compatibility.

Updating Versions

Update Node.js Version

  1. Check available cimg/node tags at CircleCI Node Images

  2. Update the FROM line in Dockerfile:

    FROM cimg/node:22.19.0  # Pinned to specific version
  3. Update the tag in Makefile:

    TAG=node-lts-gcloudsdk538.0.0-v1  # Use lts or specific version number
  4. Update the test script tag in test-image.sh

  5. Test the changes: ./test-image.sh

Update Google Cloud SDK Version

  1. Find latest version:

    curl -s https://packages.cloud.google.com/apt/dists/cloud-sdk/main/binary-all/Packages | grep "Version:" | sort -V | tail -5
  2. Update GOOGLE_SDK_VERSION in Dockerfile:

    ARG GOOGLE_SDK_VERSION=538.0.0-0  # Change to desired version
  3. Update the tag in Makefile and test-image.sh

  4. Test the changes: ./test-image.sh

Update Other Tools

Edit the respective ARG variables in the Dockerfile:

  • SKAFFOLD_VERSION for Skaffold
  • HELM_VERSION for Helm

Troubleshooting

Common Issues

Architecture Issues in CircleCI

  • Error: "found arm64 but need [amd64 i386 386]"
  • Solution: Rebuild with make push (builds for amd64 automatically)
  • Cause: Image was built on Apple Silicon (arm64) but CircleCI needs amd64

Google Cloud SDK Installation Fails

  • Ensure you're using the correct package name (google-cloud-cli vs google-cloud-sdk)
  • Check version compatibility with the base Node.js image

Node.js Version Mismatch

  • Important: CircleCI's cimg/node:22.19 is a floating tag that updates to newer patch versions
  • To lock to an exact version, use specific version tag: FROM cimg/node:22.19.0
  • For ultimate locking, use SHA digest: FROM cimg/node:22.19.0@sha256:...
  • Verify the exact version: docker run --rm cimg/node:VERSION node --version
  • Find image digests at: CircleCI Docker Hub

Build Performance

  • Docker layers are cached for faster rebuilds
  • Use docker system prune if builds become slow

Available Tags

See Dockerhub for all available tags.

Contributing

  1. Make your changes
  2. Run tests: ./test-image.sh
  3. Ensure all tests pass before pushing
  4. Update this README if changing versions or adding features

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6