To deploy to Cloud Run, you need to provide a *container image*.
A container image is a packaging format that includes your code, its
packages, any needed binary dependencies, the operating system to use, and
anything else needed to run your service.

## Dockerfile

A file named [Dockerfile](https://docs.docker.com/engine/reference/builder/) is
commonly used to declare how to build the container image.
You can find examples
of Dockerfiles for popular languages in the
[build and deploy quickstart](https://docs.cloud.google.com/run/docs/quickstarts.md.txt#build-and-deploy-a-web-service).

Dockerfiles very often start from a base image (e.g. `FROM golang:1.11`).
You can find base images maintained by OS and language authors on
[Docker Hub](https://hub.docker.com/).
Cloud Build checks for [cached images](https://docs.cloud.google.com/container-registry/docs/pulling-cached-images)
before pulling from Docker Hub. If you use a third-party build tool, you can
configure your Docker daemon to check for images in the same cache. You can also
find base images managed by Google in the
[Google Cloud Marketplace](https://console.cloud.google.com/marketplace/browse?filter=solution-type:container&filter=category:os).

> [!NOTE]
> **Note:** As of November 1, 2020, Docker Hub
> [rate limits](https://www.docker.com/blog/scaling-docker-to-serve-millions-more-developers-network-egress/) apply to unauthenticated or authenticated pull requests on the
> Docker Free plan. To avoid disruptions and have greater control over your
> software supply chain, you can migrate your dependencies to [Artifact Registry](https://docs.cloud.google.com/artifact-registry/docs/docker/migrate-external-containers.md.txt).

If you bring your own binaries, make sure they are compiled for Linux ABI
x86_64.

These resources provide further information on Dockerfiles:

- Learn Dockerfile syntax through the [Dockerfile reference](https://docs.docker.com/engine/reference/builder).
- Learn how Dockerfiles fit together through the tips in [Best practices for writing Dockerfiles](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/).

## Buildpacks

[Google Cloud's buildpacks](https://docs.cloud.google.com/docs/buildpacks/builders.md.txt) helps you build source code
from a set of supported languages into container images without the need for a
Dockerfile.

## What's next

After you have containerized your code,
[build a container image](https://docs.cloud.google.com/run/docs/building/containers.md.txt) then continue iterating
in [local testing](https://docs.cloud.google.com/run/docs/testing/local.md.txt).