The OS only runtime is a language-independent, general-purpose runtime for
Cloud Run [source](https://docs.cloud.google.com/run/docs/deploying-source-code.md.txt) deployments. It
includes the base Ubuntu operating system (OS) without any additional
language-specific runtime components. The OS only runtime lets you deploy Go
applications from source, and binaries such as Dart and Go. You can also deploy
your own application images that you built from scratch using this runtime.

The OS only runtime enables [automatic base image updates for Cloud Run](https://docs.cloud.google.com/run/docs/configuring/services/automatic-base-image-updates.md.txt). This means your application automatically receives operating
system-level security patches and updates, even when you don't use a specific
[supported language runtime](https://docs.cloud.google.com/run/docs/runtime-support.md.txt#support_schedule).

## Supported stack

The OS only runtime is available on the
[`google-24`](http://us-central1-docker.pkg.dev/serverless-runtimes/google-24-full/run%2Funiversal)
stack. For more information about the available OS only runtime versions, and the
support schedule, see the [Runtime lifecycle](https://docs.cloud.google.com/docs/buildpacks/runtime-support.md.txt#os-only).

## Compiled binaries

The OS only runtime lets you deploy pre-compiled binaries. You
can also target a base image using a runtime alias. For example, to use the
[`google-24/osonly24`](http://us-central1-docker.pkg.dev/serverless-runtimes/google-24/runtimes/osonly24) base image, specify the alias, `osonly24`.

For compiled languages, make sure that you build the binary targeting
a Linux OS before you deploy:

### Go

Compile a Go application targeting `linux/amd64`:

```bash
GOOS="linux" GOARCH=amd64 go build main.go
```

### Dart

Compile a Dart application targeting `linux/amd64`:

```bash
dart compile exe --target-os=linux --target-arch=x64 \
    bin/server.dart -o server
```

## Deploy to Cloud Run

To deploy your binary to Cloud Run, use the
[`gcloud run deploy`](https://docs.cloud.google.com/sdk/gcloud/reference/run/deploy.md.txt) command and specify
the base image (for example, `osonly24`):

```bash
gcloud beta run deploy SERVICE \
--source . \
--no-build \
--base-image=osonly24 \
--project PROJECT_ID \
--allow-unauthenticated \
--command COMMAND
```

Replace the following:

- <var translate="no">SERVICE</var>: the name of your Cloud Run service.
- <var translate="no">PROJECT_ID</var>: the Google Cloud project ID.
- <var translate="no">COMMAND</var>: the command that the container starts up with, for example, `./main` or `./server`.

For more information on deploying from source without build, see [Deploy services from source code](https://docs.cloud.google.com/run/docs/deploying-source-code.md.txt#deploy_from_source_without_build).