cloud-run-bash-example icon indicating copy to clipboard operation
cloud-run-bash-example copied to clipboard

Example webserver in bash on Google Cloud Run

Cloud Run Server in Bash

Run on Google Cloud

This is a sample repository that runs a "server" in bash that can be deployed on Google Cloud Run.

See also https://github.com/matti/google-cloud-run-shell for real shell access

Setup

  1. Enable Cloud Build and Cloud Run:

    gcloud services enable --project "${PROJECT_ID}" \
      cloudbuild.googleapis.com \
      run.googleapis.com
    
  2. Build the container:

    gcloud builds submit \
      --project "${PROJECT_ID}" \
      --tag "gcr.io/${PROJECT_ID}/hello-world-bash" \
      .
    
  3. Deploy the container:

    gcloud beta run deploy "hello-world-bash" \
      --project "${PROJECT_ID}" \
      --platform "managed" \
      --region "us-central1" \
      --image "gcr.io/${PROJECT_ID}/hello-world-bash" \
      --allow-unauthenticated
    
  4. That's it!