skip to Main Content

I recently joined a new project where Firebase functions are deployed using the firebase deploy command. However, upon checking the Google Cloud Platform Container Registry, I noticed Docker images corresponding to these function deployments. Strangely, the project owner claims they don’t utilize Docker, and there are no Docker YAML files in the repository. How could the Firebase function deployments end up in the Container Registry without explicit Docker usage? Any insights or explanations would be greatly appreciated. Thank you!

2

Answers


  1. Cloud Functions deployments are all docker images. When you deploy a function, GCP automatically creates a docker image for your function code and the chosen runtime.

    You should review the documentation for more detail:

    When you deploy your function’s source code to Cloud Functions, that source is stored in a Cloud Storage bucket. Cloud Build then automatically builds your code into a container image and pushes that image to a image registry. Cloud Functions accesses this image when it needs to run the container to execute your function.

    Login or Signup to reply.
  2. As it was already mentioned, GCP used to create the source code image in Container Image by default. Now that Container Image is going to be retired, the default option to host the image is Artifact Registry, as mentioned in the documentation:

    Docker Registry to use for storing the function’s Docker images. The option artifact-registry is used by default.

    Warning: Artifact Registry and Container Registry have different image storage costs. For more details, please see https://cloud.google.com/functions/pricing#deployment_costs.

    DOCKER_REGISTRY must be one of: artifact-registry, container-registry.

    Now, if you need to migrate the Cloud Function image to Artifact Registry, you can re-deploy the CF with the tag:

    --docker-registry=artifact-registry
    
    • For CF gen 1: re-deploy by setting the tag –docker-registry=artifact-registry
    • For CF gen 2: no action required, Artifact Registry is supported out of the box according to the documentation.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search