Sign inSign up

floci/floci-gcp

Sponsored OSS

By Floci

Updated about 18 hours ago

Light, fluffy, and always free - GCP Local Emulator

Image
Developer tools
3

50K+

floci/floci-gcp repository overview

floci-gcp

floci-gcp

Any Cloud. Locally.
Light, fluffy, and always free: the GCP local emulator

Latest Release Docker Pulls License: MIT Stars


A free, open-source local GCP emulator for development, testing, and CI. No account. No auth token. No feature gates.

Google ships a separate emulator per service, each its own process on its own port. floci-gcp replaces all of them with one binary on a single port, reusing the *_EMULATOR_HOST variables the GCP SDKs already honor.

EmulatorCloudPort
flociAWS4566
floci-azAzure4577
floci-gcpGCP4588
floci-ociOCI4599

Quick Start

# docker-compose.yml
services:
  floci-gcp:
    image: floci/floci-gcp:latest
    ports:
      - "4588:4588"
    volumes:
      - ./data:/app/data
      - /var/run/docker.sock:/var/run/docker.sock  # Cloud Run, Cloud SQL, Kafka, GKE
    environment:
      FLOCI_GCP_HOSTNAME: floci-gcp
      FLOCI_GCP_BASE_URL: http://floci-gcp:4588
      FLOCI_GCP_STORAGE_MODE: hybrid
docker compose up -d

export PUBSUB_EMULATOR_HOST=localhost:4588
export FIRESTORE_EMULATOR_HOST=localhost:4588
export DATASTORE_EMULATOR_HOST=localhost:4588
export STORAGE_EMULATOR_HOST=http://localhost:4588
export SECRET_MANAGER_EMULATOR_HOST=localhost:4588
export FIREBASE_AUTH_EMULATOR_HOST=localhost:4588
export GOOGLE_CLOUD_PROJECT=floci-local

Credentials are not cryptographically validated. The exception is a Floci-issued downscoped token, whose GCS requests are evaluated against its Credential Access Boundary.

Why floci-gcp?

Capabilityfloci-gcpGCP official emulators
Single port for all servicesYesNo
gRPC and REST on the same portYesNo
Pub/Sub, Firestore, DatastoreYesYes
Cloud StorageYesLimited
Secret Manager, KMS, IAM, LoggingYesNo
Cloud Run, Cloud Functions, GKEYesNo
Cloud SQL, Cloud Tasks, Cloud SchedulerYesNo
Managed Kafka, Eventarc, BigQueryYesNo
Native binaryYesNo

All services share port 4588 via HTTP/2 ALPN negotiation.

Services

CategoryServices
Storage and documentsCloud Storage (GCS), Firestore, Datastore
Messaging and eventsPub/Sub, Managed Kafka, Eventarc
Security and identitySecret Manager, Cloud KMS, IAM, IAM Service Account Credentials, Firebase Auth (Identity Platform)
Containers and serverlessGKE, Cloud Run, Cloud Functions
Task schedulingCloud Tasks, Cloud Scheduler
DatabasesCloud SQL for PostgreSQL
AnalyticsBigQuery (Phase 1)
ObservabilityCloud Logging, Cloud Monitoring
API managementService Usage, Cloud Resource Manager

floci-gcp speaks the real wire protocols: protobuf over gRPC for Pub/Sub, Firestore, Secret Manager, and Cloud Storage v2; binary HTTP/protobuf for Datastore; REST XML and JSON for Cloud Storage; REST JSON for management APIs.

Real Docker where fidelity matters. Each is gated by a *_MOCK flag to run metadata-only without Docker.

ServiceDefault imageMock flag
Managed Kafkaredpandadata/redpanda:latestFLOCI_GCP_SERVICES_KAFKA_MOCK
Cloud SQL for PostgreSQLpostgres:15.18-alpine (15 to 18)FLOCI_GCP_SERVICES_CLOUDSQL_MOCK
Cloud RunUser-specified imageFLOCI_GCP_SERVICES_CLOUDRUN_MOCK
GKErancher/k3s:latestFLOCI_GCP_SERVICES_GKE_MOCK

Migrating from gcloud emulators

gcloud emulatorfloci-gcp
PUBSUB_EMULATOR_HOST=localhost:8085localhost:4588
FIRESTORE_EMULATOR_HOST=localhost:8080localhost:4588
DATASTORE_EMULATOR_HOST=localhost:8081localhost:4588
FIREBASE_AUTH_EMULATOR_HOST=localhost:9099localhost:4588
(no official emulator)STORAGE_EMULATOR_HOST=http://localhost:4588
(no official emulator)SECRET_MANAGER_EMULATOR_HOST=localhost:4588

The SDKs skip credential checks automatically when these are set, so no code changes are needed.

Configuration

VariableDefaultDescription
FLOCI_GCP_PORT4588Port for all services, gRPC and REST
FLOCI_GCP_DEFAULT_PROJECT_IDfloci-localDefault project ID
FLOCI_GCP_BASE_URLhttp://localhost:4588Base URL returned in responses
FLOCI_GCP_HOSTNAME(unset)Hostname in returned URLs (Docker Compose)
FLOCI_GCP_STORAGE_MODEmemorymemory, persistent, hybrid, or wal
FLOCI_GCP_STORAGE_PERSISTENT_PATH./dataDirectory for persisted state
FLOCI_GCP_SERVICES_DOCKER_NETWORK(unset)Network that spawned sidecars join

Full reference: floci.io/floci-gcp/configuration

Multi-project isolation: the project ID is the tenancy boundary, resolved from the projects/{project}/... path, then the x-goog-request-params header, then FLOCI_GCP_DEFAULT_PROJECT_ID.

Test harness endpoints: GET /health, GET /_floci-gcp/info, and POST /_floci-gcp/state/reset to wipe state between tests without a restart.

Compatibility Testing

Validated across the Java, Node.js, Python, and Go GCP SDKs, the gcloud CLI, and both Terraform and OpenTofu with the Google provider. See compatibility-tests.

Image Tags

ChannelTag
Release, floatinglatest
Release, pinnedx.y.z
Nightlynightly, nightly-mmddyyyy

Stable releases ship on the 1st and 3rd Tuesday of each month. nightly tracks main.

Resources

License

MIT. Use it however you want.

Tag summary

Content type

Image

Digest

sha256:ea29a53b3

Size

53.4 MB

Last updated

5 days ago

docker pull floci/floci-gcp

This week's pulls

Pulls:

8,461

Last week