Why is my Docker image failing on GCP Cloud Run while working locally?

0
0
Asked By CuriousCat97 On

Hey everyone! I'm trying to run a Docker image with an older Ruby version on Debian, and while it works perfectly in my local environment with Docker Compose, I'm facing a "Service Unavailable" error when deploying to GCP Cloud Run. It seems like there might be an incompatibility with the current Ubuntu version that's being used in the infrastructure. Unfortunately, I can't upgrade Ruby due to some legacy constraints since we're in the process of rewriting the application in another language. Does anyone have any tips or solutions to get this running on Cloud Run as it is? Thanks!

5 Answers

Answered By TechWiz123 On

Have you tried configuring the underlying host OS? I remember being able to control the host image pretty well back when I worked with GCP. It might help to align it better with your local setup.

LegacyCoder42 -

I actually tested it with Ubuntu 18, and it works fine! Maybe I should ask the infrastructure team to downgrade the OS version? The problems started when I switched to the official Ruby image, which had some outdated Debian dependencies causing the build to fail. I reverted back to a Debian base image and manually installed the old Ruby version. That fixed it locally, but the GCP deployment still fails.

Answered By CloudGuru On

Could you provide a bit more detail? Checking the logs might give you insights into what's failing. Also, make sure your app is configured to start on the same port as the Cloud Run service, which is usually 8080.

Answered By LogMaster88 On

What about the logs or health checks? If it's failing on Cloud Run, the logs should give you some clues about the issue. Have you looked into that?

Answered By DevOpsNinja On

I recommend building your image starting from a Debian base, like your local setup, instead of using Ubuntu. And double-check that you're exposing the right port in your configuration!

Answered By CompileErrorX On

Just a thought—did you build the image on an ARM64 MacBook and then push it to run on an AMD64/x86 platform? I've accidentally done that a bunch of times before and it caused issues.

CuriousCat97 -

Wow, that sounds like something I would do too! I’ll check that right away.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.