Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install the Java version used by the Firebase Local Emulator in the Firebase builder image #441

Closed
korneel opened this issue Aug 20, 2020 · 2 comments · Fixed by #541
Closed

Comments

@korneel
Copy link

korneel commented Aug 20, 2020

Affected builder image

firebase (https://github.com/GoogleCloudPlatform/cloud-builders-community/tree/master/firebase)

Expected Behavior

Being able to run tests using the Firebase Local Emulator by running the command firebase emulators:exec --only=firestore ./test.sh.

Actual Behavior

The Firebase Local Emulator can't be started because Java is not available: Firestore Emulator has exited because java is not installed, you can install it from https://openjdk.java.net/install/

Steps to Reproduce the Problem

  1. Build and push the Firebase community builder image to a Google Cloud project as described here.

  2. Create a cloudbuild.yaml file:

steps:
  - name: 'gcr.io/$PROJECT_ID/firebase'
    args: ['emulators:exec', '--only=firestore', './test.sh']
  1. Create a test.sh file:
#!/bin/sh
echo "Hello, world! The time is $(date)."
  1. Start the build:
gcloud builds submit --config cloudbuild.yaml .

Additional Info

The Java version used by the Firebase Local Emulator should be installed in the Firebase builder image.

As a workaround, the Firebase Local Emulator can be used if you change FROM node to FROM timbru31/java-node in de Dockerfile of the Firebase community builder image before building and pushing it to your Google Cloud project's Container Registry.

@akauppi
Copy link

akauppi commented Mar 23, 2021

I found some packaging I'd done for this in Aug 2020 and turned it to support Cloud Registry. https://github.com/akauppi/firebase-custom-builder

@xSAVIKx
Copy link
Contributor

xSAVIKx commented Nov 3, 2021

There's also a super-charged version of the Firebase emulators suite available here: https://github.com/SpineEventEngine/gcp-emulators/tree/master/firebase-emulator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants