Ulisesuarez / pubsub-emulator

A Docker image for the Google Cloud SDK Pub/Sub Emulator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repository contains configuration for a Docker image that contains the Google Cloud Pub/Sub emulator. It is simply a Dockerised version of https://cloud.google.com/pubsub/docs/emulator.

Usage

Command Line

This shell statement shows the basic usage, which will create a Pub/Sub emulator running on port 8085, with a project name of "testproject", a default topic of "testtopic" and a subscription of "testsubscription".

docker run --rm --publish 8085:8085 jessejacksondocker/pubsub-emulator:latest

You can also configure the Pub/Sub project name, topic name, subscription name and exposure port:

docker run --rm --env PUBSUB_PROJECT=myproject --env PUBSUB_TOPIC=mytopic --env PUBSUB_SUBSCRIPTION=mysubscription --env PUBSUB_PORT=10101 --publish 10101:10101 jessejacksondocker/pubsub-emulator:latest

Docker Compose

This is the equivalent configuration for docker-compose, with custom environment variables for the project name, topic name, subscription name and Pub/Sub port.

version: '3'
  services:
    pubsub:
      image: jessejacksondocker/pubsub-emulator:latest
      ports:
        - "10101:10101"
      environment:
        - PUBSUB_PORT=10101
        - PUBSUB_PROJECT=myproject
        - PUBSUB_TOPIC=mytopic
        - PUBSUB_SUBSCRIPTION=mysubscription

About

A Docker image for the Google Cloud SDK Pub/Sub Emulator

License:MIT License


Languages

Language:Shell 75.7%Language:Dockerfile 13.8%Language:Python 10.6%