Skip to content

Instantly share code, notes, and snippets.

@NathanHowell
Created February 13, 2020 23:53
Show Gist options
  • Save NathanHowell/b5e227f10fc57b85473f76255c62b8b3 to your computer and use it in GitHub Desktop.
Save NathanHowell/b5e227f10fc57b85473f76255c62b8b3 to your computer and use it in GitHub Desktop.
lightweight pubsub emulator image
FROM alpine@sha256:ddba4d27a7ffc3f86dd6c2f92041af252a1f23a8e742c90e6e1297bfa1bc0c45 AS build
RUN apk add --no-cache ca-certificates curl python3
ARG CLOUD_SDK_VERSION=280.0.0
RUN curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${CLOUD_SDK_VERSION}-linux-x86_64.tar.gz \
| tar xzf -
RUN /google-cloud-sdk/install.sh \
--bash-completion=false \
--override-components beta pubsub-emulator \
--path-update=false \
--usage-reporting=false
FROM adoptopenjdk/openjdk11:x86_64-alpine-jre-11.0.6_10@sha256:6976e4105fbd639fc2f61ac974578209587d7f0e29607065661c5aaf92649242
RUN apk add --no-cache tini
COPY --from=build /google-cloud-sdk/platform/pubsub-emulator /pubsub-emulator
ENTRYPOINT ["/sbin/tini", "--", "java", "-jar", "/pubsub-emulator/lib/cloud-pubsub-emulator-0.1-SNAPSHOT-all.jar"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment