Oxcart Download
Menu

Run and test Google Cloud Run containers locally on a Mac

To test a Cloud Run service on an Apple silicon Mac, build it for linux/amd64 and run it with the PORT variable: docker run -e PORT=8080 -p 8080:8080 IMAGE. On Oxcart both our own service and Google’s Cloud Run sample ran this way, the amd64 images through Rosetta, so you test the exact image you deploy.

Updated

The Cloud Run container contract

Cloud Run runs any container that follows a short contract. Google’s documentation says requests go to port 8080 by default, the PORT environment variable is set on the ingress container, and the container “must listen for requests on 0.0.0.0” and “should not listen on 127.0.0.1”. It also says Cloud Run “specifically supports the Linux x86_64 ABI format” and that a multi-architecture image must include linux/amd64.

Two of those rules trip up Mac developers: an app that binds localhost works in a local terminal and fails in Cloud Run, and an image built natively on Apple silicon is arm64. Testing the real container locally catches both before you deploy.

Test a Cloud Run service locally on Apple silicon

  1. Listen on $PORT and 0.0.0.0. Make the server read the PORT environment variable (Cloud Run sends requests to 8080 by default) and bind 0.0.0.0, not 127.0.0.1.
  2. Build for linux/amd64. Run docker buildx build --platform linux/amd64 --load -t my-service .. Cloud Run supports the Linux x86_64 ABI, so an arm64 image built natively on your Mac is the wrong target.
  3. Run it as Cloud Run would. Run docker run --rm --platform linux/amd64 -e PORT=8080 -p 8080:8080 my-service. Oxcart runs the amd64 image through Rosetta.
  4. Call it. Run curl localhost:8080. To check the PORT handling, start a second copy with -e PORT=9090 -p 9090:9090.
  5. Push to Artifact Registry. Run gcloud auth configure-docker REGION-docker.pkg.dev once, then tag the image as REGION-docker.pkg.dev/PROJECT/REPO/my-service:TAG and docker push it.

What we ran on Oxcart

A small Python service that binds $PORT, run twice with different ports, plus Google’s own sample image:

docker run -d -e PORT=8080 -p 18081:8080 my-service
docker run -d -e PORT=9090 -p 18090:9090 my-service
curl localhost:18081        # hello from PORT=8080
curl localhost:18090        # hello from PORT=9090

docker run -d -e PORT=8080 -p 8081:8080 us-docker.pkg.dev/cloudrun/container/hello
docker image inspect us-docker.pkg.dev/cloudrun/container/hello --format '{{.Os}}/{{.Architecture}}'
# linux/amd64
curl localhost:8081         # "It's running!"

Google’s sample is an amd64-only image; Oxcart pulled it and ran it through Rosetta without extra flags. For amd64-only images you build yourself, pass --platform linux/amd64 on docker run as well: in our tests a locally built amd64 image was found only when the platform was given.

Building for linux/amd64 on Apple silicon

# Cloud Run target: amd64
docker buildx build --platform linux/amd64 --load -t my-service:amd64 .

# Both architectures in the local image store (runs locally either way)
docker buildx build --platform linux/amd64,linux/arm64 -t my-service:multi .

Oxcart’s default builder lists both linux/amd64 and linux/arm64, and the multi-platform build completes locally with both variants runnable. Pushing a multi-platform image from Oxcart is not supported, so for Cloud Run push the amd64 tag, which is the one it runs. Builds are quick: 341 ms uncached and 121 ms cached for a small local context, the fastest of the three runtimes we tested.

Push to Artifact Registry and deploy

gcloud auth configure-docker us-central1-docker.pkg.dev
docker tag my-service:amd64 us-central1-docker.pkg.dev/my-project/apps/my-service:1.0.0
docker push us-central1-docker.pkg.dev/my-project/apps/my-service:1.0.0
gcloud run deploy my-service \
  --image us-central1-docker.pkg.dev/my-project/apps/my-service:1.0.0 --region us-central1

Dependencies with Compose

A Cloud Run service usually talks to a database, a cache or another service. Run them next to it with Compose, set PORT in the service’s environment, and gate start order on healthchecks:

services:
  api:
    build: .
    platform: linux/amd64
    environment:
      PORT: "8080"
      REDIS_URL: redis://cache:6379
    ports: ["8080:8080"]
    depends_on:
      cache:
        condition: service_healthy
  cache:
    image: redis:7-alpine
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 2s
      retries: 30

docker compose up -d --wait returns once the cache is healthy and the API has started. The Compose on Apple silicon guide covers healthchecks, amd64 images and ports in depth.

Ports on your Mac

Published ports listen on all of the Mac’s interfaces, as with Docker’s default. If another Mac app already listens on 127.0.0.1:8080, localhost:8080 can reach that app instead of your container, so pick a free host port (-p 18080:8080) and keep PORT as Cloud Run sets it. Oxcart’s Ports view shows every listener on the Mac next to your containers, and explains why a container port is not answering, including a server bound to 127.0.0.1 inside the container, the same mistake Cloud Run rejects. See container networking on a Mac.

Questions

How do I run a Cloud Run service locally on a Mac?

Run its container with the PORT variable set and the port published: docker run -e PORT=8080 -p 8080:8080 IMAGE. That is the method Google documents for local testing with Docker. On Oxcart we verified it with our own image on ports 8080 and 9090 and with Google’s us-docker.pkg.dev/cloudrun/container/hello sample.

Why does my Cloud Run deploy fail with an image built on Apple silicon?

Google documents that Cloud Run supports the Linux x86_64 ABI and that a multi-architecture image must include linux/amd64. A plain docker build on an Apple silicon Mac produces an arm64 image. Build with --platform linux/amd64.

Can I run the amd64 image on my Mac before deploying?

Yes. Oxcart runs linux/amd64 images through Rosetta. Pass --platform linux/amd64 when you run an amd64-only image you built locally; pulled amd64 images, such as Google’s hello sample, ran without it in our test.

My container works locally but Cloud Run says it failed to listen on the port. Why?

The most common cause is binding to 127.0.0.1 or a hard-coded port. Cloud Run’s container contract says the container must listen on 0.0.0.0 on the port in PORT. Test locally with a non-default PORT (for example 9090) to catch hard-coded ports.

Do I need gcloud beta code dev or Cloud Code?

No, they are optional. Google lists plain Docker, Docker with Google Cloud access, the Cloud Code emulator and gcloud beta code dev as ways to test locally. Docker on Oxcart lets you test the image and its PORT handling directly. gcloud beta code dev adds a Kubernetes-based development workflow using minikube or an existing Kubernetes context; choose it when you need that integration.

How do I give the local container access to Google Cloud APIs?

Mount credentials the way Google documents for “Docker with Google Cloud access”, typically Application Default Credentials passed in through a mounted file and GOOGLE_APPLICATION_CREDENTIALS. Outbound connections from containers on Oxcart are opened by your Mac, so your VPN and DNS apply.

Sources and method

  • Examples tested with Oxcart 0.1.2, Mac17,14, macOS 27.2, 2026-10-10 (PORT on 8080 and 9090, Google’s hello sample as linux/amd64, Buildx single- and multi-platform builds).
  • Cloud Run container contract (port, 0.0.0.0, x86_64): https://docs.cloud.google.com/run/docs/container-contract. Local testing options: https://docs.cloud.google.com/run/docs/testing/local and https://docs.cloud.google.com/sdk/gcloud/reference/beta/code/dev. Checked 2026-10-10.
  • Build speed: Oxcart 0.1.2, 2026-10-10, Apple M5 Max, 8 CPUs and 12 GiB, medians of five samples; the other runtimes were measured earlier the same day on the same Mac and harness with the docker 29.4 client.

Try Oxcart on your own projects

Free for 60 days. Then one license, every update for life: not a subscription.

Mac with Apple silicon · Windows 11 (x64)

Read next

Release notes

Oxcart 26.11.6

Latest release

Containers see the changes you make to files on your Mac as they happen.

  • Edit a file in a shared folder on your Mac, and tools that watch it in a container, such as Vite, webpack and nodemon, reload right away. Polling is not needed.
  • When no containers are running and you haven't used Docker for two minutes, Oxcart gives the memory it was using back to macOS. The next docker command starts it again in under a second. This doesn't happen while Kubernetes is turned on.
  • You can bring your images, volumes and networks over from another Docker app. Choose Import from Another Runtime… in the More (…) menu on the Containers page, or run oxcart import. Containers themselves aren't copied: start them again with docker compose up -d or docker run, and they use the imported volumes and networks.
  • Bug fixes and optimizations.
  • Updated Linux and system components, with the latest security fixes. A Windows virtual machine that is suspended when you update starts fresh afterwards.

Requires macOS 26.0 or later

Oxcart 26.11.5

You can now turn on GPU acceleration for a Windows 11 virtual machine you already have.

  • Open the virtual machine's settings and turn on GPU acceleration under Display. Oxcart restarts Windows once, and the Windows desktop and Direct3D 10 and 11 apps then render on your Mac's GPU.
  • Turning GPU acceleration off puts back the standard display driver, and suspending works again.

Requires macOS 26.0 or later

Oxcart 26.11.4

Bug fixes and optimizations.

  • Virtual machines start again after updating Oxcart while it is open.

Requires macOS 26.0 or later

Oxcart 26.11.3

Windows virtual machines can now use your Mac's GPU.

  • Turn on GPU acceleration when you create a Windows 11 virtual machine, on the first step of New Virtual Machine. The Windows desktop and Direct3D 10 and 11 apps then render on your Mac's GPU instead of its processor.
  • A virtual machine with GPU acceleration can't be suspended or snapshotted while it runs. Shut it down instead. Existing virtual machines are not changed.
  • GPU acceleration is new. After a lot of opening and closing windows, the Windows screen can go black for about a second while Oxcart frees graphics memory.
  • Updated Linux and system components, with the latest security fixes.

Requires macOS 26.0 or later

Oxcart 26.11.2

Oxcart can now run Kubernetes for you.

  • Turn on Kubernetes in Settings › Resources to get a local single-node cluster that kubectl can use right away.
  • Services in the cluster are reachable from your Mac at 127.0.0.1, and images you build with Docker run in the cluster without pushing them to a registry.
  • Updated Linux and system components, with the latest security fixes.

Requires macOS 26.0 or later

Oxcart 26.11.1

Bug fixes and optimizations.

  • A simpler toolbar in the VM window.
  • Updated Linux and system components, with the latest security fixes.

Requires macOS 26.0 or later

Oxcart 26.11.0

Clearer Windows audio, a network that comes back, and a VM toolbar that stays out of your way.

  • Clear Windows audio. Choppy, garbled sound in Windows VMs is fixed.
  • Networking that recovers. Turn a Windows VM's network off and on again, and it reconnects without a restart.
  • A toolbar that stays out of the way. It no longer covers the top of your VM. Move the pointer to the top center and click the small tab when you want it.
  • Simpler Oxcart Tools for Windows. One CD now holds everything, and the installer handles the drivers and any restart for you.
  • A more dependable clipboard in Windows VMs.
  • A license agreement to accept the first time you open Oxcart on your Mac.
  • Updated Linux, container and Docker components, with the latest security fixes.

Requires macOS 26.0 or later

Oxcart 26.10.0

Virtual machines are here. Windows 11, Linux and macOS run on your Mac, built into Oxcart beside your containers and covered by the license you already have.

  • Windows 11 in about 5 minutes, hands off. Choose your Windows 11 ARM installer and walk away: Oxcart installs Windows, its drivers and Oxcart Tools by itself, on a VM with real TPM 2.0 and Secure Boot. You bring the installer and the license.
  • Linux in under a minute. Ubuntu, Debian and Fedora start with your Mac username, your SSH key and passwordless sudo already set up; Fedora is ready in about 30 seconds. Every further VM from the same image starts from an instant copy that takes only the space it changes. Ubuntu Desktop, Fedora Workstation and any arm64 Linux installer work too.
  • macOS on macOS. Oxcart restores the newest macOS your Mac supports and, with Automatic setup, creates your account and installs Oxcart Tools.
  • Every VM is a real Mac app. Each one has its own window, Dock icon and ⌘-Tab entry, and keeps running after you quit Oxcart. The Retina display follows the window as you resize it or go full screen, ⌘C and ⌘V work in Linux and Windows, and text, images and files move between your Mac and the guest by copy, paste and drag.
  • Snapshots that capture the moment. Snapshot a running VM with its open apps and return to that exact moment later. Snapshots and clones take almost no space until the guest changes, and a restore lands whole even if your Mac loses power halfway.
  • Your Mac's folders, network and USB. Share Mac folders with any guest, reach your Mac by name and publish ports from the VM. Hand a USB device to Windows for flashers, programmers and dongles; development boards' serial ports show up in Windows under their own IDs.
  • First-class for coding agents. VMs join containers in Oxcart's MCP server with 22 tools of their own, so an agent you connect can create, start, snapshot and clone VMs, run commands and copy files in the guest, forward ports, connect USB devices and disk images, and read the screen and type in any guest, even one without Oxcart Tools, all within the permission level you set for each agent. The oxcart vm command covers every operation, with JSON output for scripts and CI.
  • Encrypted VMs, when you want them. Keep a VM's disks and secrets behind a password of your own, with AES-256 encryption built into Oxcart, so an encrypted disk flushes as fast as a plain one.
  • Disk space you can see. Choose where a VM lives, on your Mac or an external drive, and see what it takes now and what it can grow to against the space you have. Reclaim Space hands back what a guest frees right away, and Disk Usage shows each downloaded system so you can remove the ones you no longer need.
  • VMs that move with you. Each VM is a single item in Finder you can keep on any drive. Export it as one .oxvm file to another Mac, and bring over Linux and macOS VMs from another Mac virtualization app.
  • Ready when you are. Chosen VMs start when you log in, run headless with no window at all, and suspend when you close them, so you pick up exactly where you left off.
  • Oxcart Help. Help › Oxcart Help (⌘?) explains every setting, what it does and what changing it affects, with a ? beside each one. Coding agents read the same help through MCP.
  • More reliable published ports. A container connection that a service closes mid-transfer now ends cleanly instead of waiting.
  • New version numbers. Releases are now numbered by year and month, so this one is 26.10.0.

Requires macOS 26.0 or later

Oxcart 0.1.8

Oxcart for Windows, and every update included for life.

  • Oxcart runs on Windows too. One license covers up to 5 devices, Mac or Windows, in any mix.
  • Every update is included, for life.
  • Oxcart is $5 through December 31, 2026.
  • Coding agents can inspect containers, read live stats and resource pressure, follow logs, track long pulls and builds, and run containers with the limits you set.
  • Recreating a container keeps its volumes and network aliases.
  • Oxcart's helper shows as Oxcart in Login Items.
  • Reliability improvements throughout.

Requires macOS 26.0 or later

Oxcart 0.1.7

Faster shared folders, faster networking, and container environments you can edit.

  • Much faster shared folders. Cloning repositories, installing packages and building in a shared folder are up to 3× faster.
  • Faster networking. Published ports and container connections move nearly twice as much data, using less CPU.
  • Encryption when you want it. Encrypting traffic between your Mac and your containers is optional: turn it on in Settings › Resources › Encrypt container connections.
  • Environment variables, easy to see and change. See a container's variables on its Overview, change them with Edit and Recreate, and paste a whole .env file at once.
  • A smoother Run Container sheet. Return moves to the next row instead of starting the container.
  • Clearer troubleshooting. Oxcart tells you when a VPN or firewall is slowing your connections.
  • More reliable shared folders, with correct permission errors and up-to-date contents after changes on your Mac.

Requires macOS 26.0 or later

Oxcart 0.1.6

Coding agents can fix what they find, plus fixes and hardening throughout.

  • New agents can start, stop and restart containers, run commands in them and bring Compose projects up, using images already on your Mac. Pulling, building and deleting require Full, set for each agent in the MCP Integrations section.
  • Setup gives every agent a ready-to-use entry, and oxcart mcp check confirms it works.
  • Sharper answers: agents see when a service is down because something it depends on is, whether a web page actually loads, and what caused a failure and how to fix it.
  • Start at login opens Oxcart in the menu bar, ready when you need it.
  • Oxcart checks for updates as it starts, and sends a short check-in to oxcart.cc. Settings › Privacy shows exactly what it contains.
  • Containers find the other services on their networks from the moment they start.
  • Fixes to privileged containers, Rosetta checks and setup safeguards.
  • The Oxcart app asks before anything that deletes data or stops running work.
  • Security hardening and reliability improvements throughout.

Requires macOS 26.0 or later

Oxcart 0.1.5

Oxcart runs local Kubernetes and privileged containers, and speaks ten languages.

  • Settings › Resources › Kubernetes and networking: turn on privileged containers to run kind, k3d, minikube (Docker driver) and Docker-in-Docker, and to use docker run --privileged and --device. It is off by default. Oxcart's guard keeps every container away from its disks, its kernel, other containers' data and its channels to your Mac.
  • IPv6 container networks, also off by default, for networks created with IPv6 such as kind's dual-stack network.
  • Oxcart is translated into Simplified Chinese, Japanese, German, French, Spanish, Brazilian Portuguese, Korean, Russian and Turkish. Settings › General › Language sets it for Oxcart only.

Requires macOS 26.0 or later

Oxcart 0.1.4

Licensing and refinements.

  • Secure email-link license activation.
  • License and Mac management from Settings.
  • Offline license verification.
  • Performance improvements, UI polish, and bug fixes.

Requires macOS 26.0 or later

Oxcart 0.1.3

Idle memory reclamation.

  • Reclaims VM memory when no containers are running.
  • Preserves containers, images, volumes, and networks.

Requires macOS 26.0 or later

Oxcart 0.1.2

Command-line tool integration.

  • Switch between Oxcart's bundled Docker tools and an existing installation.
  • UI polish.

Requires macOS 26.0 or later

Oxcart 0.1.1

Bundled Docker tools and agent controls.

  • Docker CLI 29.9, Compose 5.6, and Buildx 0.38 included.
  • Docker context integration and secure Keychain credentials.
  • MCP agent connections with per-agent permissions and blocking.

Requires macOS 26.0 or later

Oxcart 0.1.0

Docker-compatible containers for Apple silicon.

  • Docker CLI, Compose, and Buildx compatibility.
  • Offline setup with bundled runtime components.
  • Ports organized by project and Git branch.
  • MCP integration with read-only access by default.
  • Verified automatic updates.

Requires macOS 26.0 or later