While deploying a web app like React, Angular or Node projects using Google cloud, you might come across this error after pushing your app from a docker container to gcr.io (Google cloud repository)
After tracing the logs, i realised its a platform related problem and you must have built your docker image using the code below;
docker build -t {project-name} .
The code above works well on an intel system when you push to Google Cloud. but not on Apples M1, sadly 🙁
You will get an error saying:
Cloud Run: “Failed to start and then listen on the port defined by the PORT environment variable.”
this happens when building on Cloud run

Solution to the Cloud run Failed to start issue
Use the following command to build your docker image;
docker buildx build --platform linux/amd64 -t {project-name} .
Voila! 😀
Watch how to Deploy a React app on Cloud run
Related posts
4 Comments
Leave a Reply Cancel reply
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Subscribe for newsletter
* You will receive the latest news and updates on your favorite topics!
How to Downgrade Flutter Version – FIXED
Learn how to downgrade your flutter version to a lower version, in this article we will reduce the flutter version…
Generate Resources for Android Playstore & iOS Apple Store Flutter
In this post, we’ll generate resources for the flutter app we created in the previous post. we’ll be learning how…
Build a Quiz App using Flutter for Android and iOS
In this post we’ll be working with Flutter, a fast-rising Developer tool built by Google to develop an Android App,…
Setup Flutter on Kali, Ubuntu, and any other Linux Distro
In this post, we’ll be learning how to set up your Flutter on Linux for development. Flutter is a fast-rising…
FIXED xcodebuild: Failed to load code for plug-in – Repeatedly Being Asked to Install Command Line Tools
Hey there, updating your MacOS Montery Xcode can be a pin in the a$$ especially when you got Xcode working…
How to Downgrade Flutter Version – FIXED
Learn how to downgrade your flutter version to a lower version, in this article we will reduce the flutter version…
Build a Quiz App using Flutter for Android and iOS
In this post we’ll be working with Flutter, a fast-rising Developer tool built by Google to develop an Android App,…
Setup Flutter on Kali, Ubuntu, and any other Linux Distro
In this post, we’ll be learning how to set up your Flutter on Linux for development. Flutter is a fast-rising…
Hello,
I am encountering the same issue, but even using buildx I receive the following error: The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable.
Do you have any ideas on how to solve this problem?
Hi Daniel, is this a new container or an existing project? I’ll suggest you use a different gcr
I have same problem. What gcr will you recommend
Hi, can you please tell me why it works? Thanks for the solution it works for me!