Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Untuk men-deploy ke Cloud Run, Anda harus menyediakan image container.
Image container adalah format paket yang mencakup kode Anda, paketnya,
dependensi biner apa pun yang diperlukan, sistem operasi yang akan digunakan, dan
hal lain yang diperlukan untuk menjalankan layanan Anda.
Dockerfile
File bernama Dockerfile
biasa digunakan untuk mendeklarasikan cara membangun image container. Anda dapat menemukan contoh
Dockerfiles untuk bahasa populer di
panduan memulai bangun dan deploy.
Dockerfiles sering kali dimulai dari image dasar (misalnya FROM golang:1.11).
Anda dapat menemukan image dasar yang dikelola oleh penulis OS dan bahasa di
Docker Hub.
Cloud Build memeriksa image yang di-cache
sebelum mengambilnya dari Docker Hub. Jika Anda menggunakan alat build pihak ketiga, Anda dapat
mengonfigurasi daemon Docker Anda untuk memeriksa image di cache yang sama. Anda juga dapat
menemukan image dasar yang dikelola oleh Google di
Google Cloud Marketplace.
Jika Anda membawa biner sendiri, pastikan biner tersebut dikompilasi untuk ABI Linux
x86_64.
Resource ini menyediakan informasi lebih lanjut tentang Dockerfile:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-21 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)."]]