[GH-ISSUE #924] [QUESTION] docker image doesn't start on Cloud Run #577

Closed
opened 2026-02-25 20:36:04 +03:00 by kerem · 5 comments
Owner

Originally created by @clydebarrow on GitHub (Jan 4, 2023).
Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/924

Cloud Run seems like an obvious environment to run the Whoogle docker image, but it's not working.

I pulled the docker image benbusby/whoogle-search, tested it locally, then pushed it to Artifact Registry, then created a Cloud Run service using that image. I set the Cloud Run port to 5000 (also tried 8080) and set an environment variable EXPOSE_PORT to the same value. The error is:

The user-provided container failed to start and listen on the port defined provided by the PORT=5000 environment variable

Yaml config and status below. Any ideas on what might be wrong?

spec:
  containerConcurrency: 80
  timeoutSeconds: 300
  serviceAccountName: xxxxxxxx-compute@developer.gserviceaccount.com
  containers:
  - name: whoogle-1
    image: australia-southeast1-docker.pkg.dev/xxxxxxx/docker/whoogle@sha256:90cd8ad223b5b32c28a217c4cc256171928a756a4714591a711103a8ac9bcb90
    ports:
    - name: http1
      containerPort: 5000
    env:
    - name: EXPOSE_PORT
      value: '5000'
    resources:
      limits:
        cpu: 1000m
        memory: 2Gi
status:
  observedGeneration: 1
  conditions:
  - type: Ready
    status: 'False'
    reason: HealthCheckContainerError
    message: "The user-provided container failed to start and listen on the port defined\
      \ provided by the PORT=5000 environment variable. Logs for this revision might\
Originally created by @clydebarrow on GitHub (Jan 4, 2023). Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/924 Cloud Run seems like an obvious environment to run the Whoogle docker image, but it's not working. I pulled the docker image `benbusby/whoogle-search`, tested it locally, then pushed it to Artifact Registry, then created a Cloud Run service using that image. I set the Cloud Run port to 5000 (also tried 8080) and set an environment variable `EXPOSE_PORT` to the same value. The error is: ``` The user-provided container failed to start and listen on the port defined provided by the PORT=5000 environment variable ``` Yaml config and status below. Any ideas on what might be wrong? ``` yaml spec: containerConcurrency: 80 timeoutSeconds: 300 serviceAccountName: xxxxxxxx-compute@developer.gserviceaccount.com containers: - name: whoogle-1 image: australia-southeast1-docker.pkg.dev/xxxxxxx/docker/whoogle@sha256:90cd8ad223b5b32c28a217c4cc256171928a756a4714591a711103a8ac9bcb90 ports: - name: http1 containerPort: 5000 env: - name: EXPOSE_PORT value: '5000' resources: limits: cpu: 1000m memory: 2Gi status: observedGeneration: 1 conditions: - type: Ready status: 'False' reason: HealthCheckContainerError message: "The user-provided container failed to start and listen on the port defined\ \ provided by the PORT=5000 environment variable. Logs for this revision might\ ```
kerem 2026-02-25 20:36:04 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@dominickp commented on GitHub (Jan 4, 2023):

I see the health check failure, but are there any logs from the container? I haven't used Cloud Run but when a health check fails, I usually look at the container output first.

<!-- gh-comment-id:1371491310 --> @dominickp commented on GitHub (Jan 4, 2023): I see the health check failure, but are there any logs from the container? I haven't used Cloud Run but when a health check fails, I usually look at the container output first.
Author
Owner

@clydebarrow commented on GitHub (Jan 4, 2023):

I don't know of any way of getting the container output in Cloud Run. It is possible to shell into a Cloud Run container but it has to be running.

<!-- gh-comment-id:1371503250 --> @clydebarrow commented on GitHub (Jan 4, 2023): I don't know of any way of getting the container output in Cloud Run. It is possible to shell into a Cloud Run container but it has to be running.
Author
Owner

@clydebarrow commented on GitHub (Jan 4, 2023):

Just looked at the logs again and found this:

textPayload: "terminated: Application failed to start: Failed to create init process: failed to load /bin/sh: exec format error"
<!-- gh-comment-id:1371509065 --> @clydebarrow commented on GitHub (Jan 4, 2023): Just looked at the logs again and found this: ``` textPayload: "terminated: Application failed to start: Failed to create init process: failed to load /bin/sh: exec format error" ```
Author
Owner

@clydebarrow commented on GitHub (Jan 4, 2023):

I think I found the problem - I pulled the image on a Mac M1 before pushing to Artifact Registry so got an aarch64 version.

<!-- gh-comment-id:1371515081 --> @clydebarrow commented on GitHub (Jan 4, 2023): I think I found the problem - I pulled the image on a Mac M1 before pushing to Artifact Registry so got an aarch64 version.
Author
Owner

@clydebarrow commented on GitHub (Jan 4, 2023):

Replaced the image with x86-64 and it works!

but are there any logs from the container

Yes, they are in the Cloud Run logs - stdout and stderr are logged. But due to the architecture mismatch there was nothing to see in that respect.

<!-- gh-comment-id:1371529555 --> @clydebarrow commented on GitHub (Jan 4, 2023): Replaced the image with x86-64 and it works! > but are there any logs from the container Yes, they are in the Cloud Run logs - stdout and stderr are logged. But due to the architecture mismatch there was nothing to see in that respect.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/whoogle-search#577
No description provided.