Cloud Run에 배포하려면 컨테이너 이미지를 제공해야 합니다.
컨테이너 이미지는 코드와 관련 패키지, 필요한 바이너리 종속 항목, 사용할 운영체제, 서비스를 실행하는 데 필요한 기타 항목을 포함하는 패키징 형식입니다.
Dockerfile
Dockerfile이라는 파일은 일반적으로 컨테이너 이미지를 빌드하는 방법을 선언하는 데 사용됩니다. 빌드 및 배포 빠른 시작에서 많이 사용되는 언어의 Dockerfile 예시를 확인할 수 있습니다.
Dockerfile은 기본 이미지(예: FROM golang:1.11)에서 시작되는 경우가 많습니다. OS 및 언어 작성자가 관리하는 기본 이미지는 Docker Hub에서 확인할 수 있습니다.
Cloud Build는 Docker Hub에서 가져오기 전에 캐시된 이미지를 확인합니다. 타사 빌드 도구를 사용하는 경우 동일 캐시의 이미지를 확인하도록 Docker 데몬을 구성할 수 있습니다. 또한 Google Cloud Marketplace에서 Google에서 관리되는 기본 이미지를 찾을 수 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# Containerize your code\n\nTo deploy to Cloud Run, you need to provide a *container image*.\nA container image is a packaging format that includes your code, its\npackages, any needed binary dependencies, the operating system to use, and\nanything else needed to run your service.\n\nDockerfile\n----------\n\nA file named [Dockerfile](https://docs.docker.com/engine/reference/builder/) is\ncommonly used to declare how to build the container image. You can find examples\nof Dockerfiles for popular languages in the\n[build and deploy quickstart](/run/docs/quickstarts#build-and-deploy-a-web-service).\n\nDockerfiles very often start from a base image (e.g. `FROM golang:1.11`).\nYou can find base images maintained by OS and language authors on\n[Docker Hub](https://hub.docker.com/).\nCloud Build checks for [cached images](/container-registry/docs/pulling-cached-images)\nbefore pulling from Docker Hub. If you use a third-party build tool, you can\nconfigure your Docker daemon to check for images in the same cache. You can also\nfind base images managed by Google in the\n[Google Cloud Marketplace](https://console.cloud.google.com/marketplace/browse?filter=solution-type:container&filter=category:os).\n| **Note:** As of November 1, 2020, Docker Hub\n| [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\n| Docker Free plan. To avoid disruptions and have greater control over your\n| software supply chain, you can migrate your dependencies to [Artifact Registry](/artifact-registry/docs/docker/migrate-external-containers).\n\nIf you bring your own binaries, make sure they are compiled for Linux ABI\nx86_64.\n\nThese resources provide further information on Dockerfiles:\n\n- Learn Dockerfile syntax through the [Dockerfile reference](https://docs.docker.com/engine/reference/builder).\n- Learn how Dockerfiles fit together through the tips in [Best practices for writing Dockerfiles](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/).\n\nBuildpacks\n----------\n\n[Google Cloud's buildpacks](/docs/buildpacks/builders) helps you build source code\nfrom a set of supported languages into container images without the need for a\nDockerfile.\n\nWhat's next\n-----------\n\nAfter you have containerized your code,\n[build a container image](/run/docs/building/containers) then continue iterating\nin [local testing](/run/docs/testing/local)."]]