Sign inSign up

markdavydov/pubsub-emulator

By markdavydov

•Updated about 3 years ago

Sought Singularities/pubsub-emulator?Find the local image I pushed and rebuild it here.

Image
0

10K+

markdavydov/pubsub-emulator repository overview

You probably came here because you were looking for singularities/pubsub-emulator . I have pushed here the image I had locally. You can also rebuild the image here https://github.com/SingularitiesCR/pubsub-emulator-docker⁠

⁠Google Cloud Pub/Sub Emulator

A Google Cloud Pub/Sub Emulator⁠ container image. The image is meant to be used for creating an standalone emulator for testing.

⁠Environment

The following environment variables must be set:

  • PUBSUB_LISTEN_ADDRESS: The address should refer to a listen address, meaning that 0.0.0.0 can be used. The address must use the syntax HOST:PORT, for example 0.0.0.0:8432. The container must expose the port used by the Pub/Sub emulator.
  • PUBSUB_PROJECT_ID: The ID of the Google Cloud project for the emulator.

⁠Connect application with the emulator

The following environment variables need to be set so your application connects to the emulator instead of the production Cloud Pub/Sub environment:

  • PUBSUB_EMULATOR_HOST: The listen address used by the emulator.
  • PUBSUB_PROJECT_ID: The ID of the Google Cloud project used by the emulator.

⁠Custom commands

This image contains a script named start-pubsub (included in the PATH). This script is used to initialize the Pub/Sub emulator.

⁠Starting an emulator

By default, the following command is called:

start-pubsub

⁠Creating a Pub/Sub emulator with Docker Compose

The easiest way to create an emulator with this image is by using Docker Compose⁠. The following snippet can be used as a docker-compose.yml for a Pub/Sub emulator:

version: "2"

services:
  pubsub:
    image: singularities/pubsub-emulator
    environment:
      - PUBSUB_PROJECT_ID=project-test
      - PUBSUB_LISTEN_ADDRESS=0.0.0.0:8432
    ports:
      - "8432:8432"
⁠Persistence

The image has a volume mounted at /opt/data. To maintain states between restarts, mount a volume at this location.

Tag summary

Content type

Image

Digest

sha256:e939185f2…

Size

175.9 MB

Last updated

about 3 years ago

docker pull markdavydov/pubsub-emulator