Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menjelaskan cara membuat dan menyiapkan Deep Learning Container lokal.
Panduan ini mengharapkan Anda memiliki pemahaman dasar tentang Docker.
Sebelum memulai
Selesaikan langkah-langkah berikut untuk menyiapkan akun Google Cloud , mengaktifkan API yang diperlukan, serta menginstal dan mengaktifkan software yang diperlukan.
Di Google Cloud Konsol, buka halaman Kelola resource, lalu pilih atau buat project.
Jika Anda menggunakan sistem operasi berbasis Linux, seperti Ubuntu atau Debian,
tambahkan nama pengguna Anda ke grup docker agar Anda dapat menjalankan Docker
tanpa menggunakan sudo:
sudousermod-a-Gdocker${USER}
Anda mungkin perlu memulai ulang sistem setelah menambahkan diri Anda ke grup docker.
Buka Docker. Untuk memastikan Docker berjalan, jalankan perintah Docker berikut, yang menampilkan waktu dan tanggal saat ini:
docker run busybox date
Gunakan gcloud sebagai helper kredensial untuk Docker:
gcloud auth configure-docker
Opsional: Jika Anda ingin menjalankan container menggunakan GPU secara lokal,
instal
nvidia-docker.
Buat penampung Anda
Ikuti langkah-langkah berikut untuk membuat penampung.
Untuk melihat daftar penampung yang tersedia:
gcloud container images list \
--repository="gcr.io/deeplearning-platform-release"
Anda dapat membuka Memilih penampung
untuk membantu Anda memilih penampung yang diinginkan.
Jika Anda tidak perlu menggunakan container yang mendukung GPU, masukkan contoh
kode berikut. Ganti tf-cpu.1-13 dengan nama container
yang ingin Anda gunakan.
docker run -d -p 8080:8080 -v /path/to/local/dir:/home/jupyter \
gcr.io/deeplearning-platform-release/tf-cpu.1-13
Jika Anda ingin menggunakan container yang mendukung GPU, masukkan contoh kode berikut. Ganti tf-gpu.1-13 dengan nama container
yang ingin Anda gunakan.
docker run --runtime=nvidia -d -p 8080:8080 -v /path/to/local/dir:/home/jupyter \
gcr.io/deeplearning-platform-release/tf-gpu.1-13
Perintah ini memulai container dalam mode terpisah, memasang direktori
lokal /path/to/local/dir ke /home/jupyter di container, dan memetakan
port 8080 di container ke port 8080 di komputer lokal Anda. Kontainer telah dikonfigurasi sebelumnya untuk memulai server JupyterLab, yang dapat Anda kunjungi di http://localhost:8080.
Langkah berikutnya
Pelajari lebih lanjut cara bekerja dengan container di dokumentasi Docker.
[[["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-09-04 UTC."],[[["\u003cp\u003eThis guide details the process of creating and setting up a local deep learning container, requiring basic Docker knowledge.\u003c/p\u003e\n"],["\u003cp\u003eThe setup involves creating or selecting a Google Cloud project, installing and initializing the gcloud CLI, and installing Docker, with specific instructions for Linux users to avoid using \u003ccode\u003esudo\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eUsers can choose from available deep learning containers using a command to list them or visit the "Choosing a container" page, then using a command to either use a cpu container, or a gpu-enabled container.\u003c/p\u003e\n"],["\u003cp\u003eThe container is launched in detached mode, mounting a local directory to the container and mapping a port, which then allows the user to use a preconfigured JupyterLab server.\u003c/p\u003e\n"],["\u003cp\u003eOptionally, for those requiring GPU acceleration, the guide suggests installing \u003ccode\u003envidia-docker\u003c/code\u003e, and using the appropriate container creation command.\u003c/p\u003e\n"]]],[],null,["# Get started with a local deep learning container\n\nThis page describes how to create and set up a local deep learning container.\nThis guide expects you to have basic familiarity\nwith [Docker](https://www.docker.com/).\n\nBefore you begin\n----------------\n\nComplete the following steps to set up a Google Cloud account, enable\nthe required APIs, and install and activate the required software.\n\n1. In the Google Cloud Console, go to the **Manage resources** page\n and select or create a project.\n\n | **Note:** If you don't plan to keep the resources you create in this tutorial, create a new project instead of selecting an existing project. After you finish, you can delete the project, removing all resources associated with the project and tutorial.\n\n [Go to Manage\n resources](https://console.cloud.google.com/cloud-resource-manager)\n2. [Install and initialize the\n gcloud CLI](/sdk/docs).\n\n3. [Install Docker](https://docs.docker.com/install/).\n\n If you're using a Linux-based operating system, such as Ubuntu or Debian,\n add your username to the `docker` group so that you can run Docker\n without using `sudo`: \n\n sudo usermod -a -G docker ${USER}\n\n | **Caution:** The `docker` group is equivalent to the `root` user. See [Docker's documentation](https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface) for details on how this affects the security of your system.\n\n You may need to restart your system after adding yourself to\n the `docker` group.\n4. Open Docker. To ensure that Docker is running, run the following\n Docker command, which returns the current time and date:\n\n docker run busybox date\n\n5. Use `gcloud` as the credential helper for Docker:\n\n gcloud auth configure-docker\n\n6. **Optional** : If you want to run the container using GPU locally,\n install\n [`nvidia-docker`](https://github.com/NVIDIA/nvidia-docker#quickstart).\n\nCreate your container\n---------------------\n\nFollow these steps to create your container.\n\n1. To view a list of containers available:\n\n gcloud container images list \\\n --repository=\"gcr.io/deeplearning-platform-release\"\n\n You may want to go to [Choosing a container](/deep-learning-containers/docs/choosing-container)\n to help you select the container that you want.\n2. If you don't need to use a GPU-enabled container, enter the following code\n example. Replace \u003cvar translate=\"no\"\u003etf-cpu.1-13\u003c/var\u003e with the name of the container\n that you want to use.\n\n docker run -d -p 8080:8080 -v /path/to/local/dir:/home/jupyter \\\n gcr.io/deeplearning-platform-release/\u003cvar translate=\"no\"\u003etf-cpu.1-13\u003c/var\u003e\n\n If you want to use a GPU-enabled container, enter the following code\n example. Replace \u003cvar translate=\"no\"\u003etf-gpu.1-13\u003c/var\u003e with the name of the container\n that you want to use. \n\n docker run --runtime=nvidia -d -p 8080:8080 -v /path/to/local/dir:/home/jupyter \\\n gcr.io/deeplearning-platform-release/\u003cvar translate=\"no\"\u003etf-gpu.1-13\u003c/var\u003e\n\nThis command starts up the container in detached mode, mounts the local\ndirectory `/path/to/local/dir` to `/home/jupyter` in the container, and maps\nport 8080 on the container to port 8080 on your local machine. The\ncontainer is preconfigured to start a JupyterLab server, which you can\nvisit at `http://localhost:8080`.\n\nWhat's next\n-----------\n\n- Learn more about how to work with containers in the [Docker\n documentation](https://docs.docker.com)."]]