Search code examples
google-cloud-platformflutter-webgcloudgoogle-cloud-run

Flutter web App fails to deploy on cloud Run


I am trying to follow example at How to deploy Flutter WebApp using Google Cloud Run and it says

Create a Dockerfile in the root folder; this file configures the Docker image and containerizes the app. Copy the following content into your Dockerfile

that I created as well as server.sh in server folder ,

When I run

gcloud builds submit — tag gcr.io/{PROJECT_ID}/{YOUR-IMAGE-NAME}:$tag .

 C:\projects\myproject11>gcloud builds submit — tag gcr.io/myproject11/xyz:1.0
ERROR: (gcloud.builds.submit) unrecognized arguments:
  tag
  gcr.io/myproject11/xyz:1.0
  To search the help text of gcloud commands, run:
  gcloud help -- SEARCH_TERMS

C:\projects\myproject11>

Solution

  • Seems the error is due to long dash tag in the command you are trying to run. You need to add the -- before tag to indicate that it's a flag.you can check this document for examples

    As mentioned here, looks like you are also facing the same issue as you following the example in medium .

    The code block changes “dash dash tag” to “long dash tag” in Medium code block formatting.It should be :

    gcloud builds submit --tag gcr.io/$PROJECT_ID/pdf-service