פעילות בקונטיינר ב-Docker Container
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
אפשר גם להריץ את הדוגמאות ולפתח את האפליקציה של Google Ads API בתוך קונטיינר Docker, שנבנה באמצעות Dockerfile ו-docker-compose.yml שסופקו.
כדי לעשות זאת (בתנאי שהתקנתם סביבת Docker), מריצים את הפקודה הבאה בספרייה שבה שיבטתם את המאגר הזה:
docker-compose up --build -d
כך תקבלו מופע של קונטיינר Docker עם סביבת ההפעלה שהוגדרה.
כדי לפתוח מעטפת Bash בתוך קונטיינר Docker, מריצים את הפקודה docker ps
כדי לקבל את מזהה הקונטיינר, ואז מריצים את הפקודה:
docker exec -it <YOUR_CONTAINER_ID> bash
כך תוכלו להריץ דוגמאות קוד ואפליקציות אחרות בתוך הקונטיינר.
כקיצור דרך, אם יש לכם רק קונטיינר Docker אחד שפועל במחשב, אתם יכולים גם להריץ את הפקודה הבאה:
docker exec -it $(docker ps -a -q) bash
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-27 (שעון UTC).
[null,null,["עדכון אחרון: 2025-08-27 (שעון UTC)."],[[["\u003cp\u003eUtilize provided Docker resources to execute Google Ads API application examples and develop your own applications within a Docker container.\u003c/p\u003e\n"],["\u003cp\u003eInitiate the Docker environment by executing \u003ccode\u003edocker-compose up --build -d\u003c/code\u003e after cloning the repository.\u003c/p\u003e\n"],["\u003cp\u003eAccess a Bash shell inside the container using \u003ccode\u003edocker exec -it <YOUR_CONTAINER_ID> bash\u003c/code\u003e to interact with code samples and applications.\u003c/p\u003e\n"],["\u003cp\u003eIf running a single Docker container, \u003ccode\u003edocker exec -it $(docker ps -a -q) bash\u003c/code\u003e can be used as a shortcut for shell access.\u003c/p\u003e\n"]]],[],null,["# Running in a Docker Container\n\nYou can also execute the examples and develop your Google Ads API application\ninside a Docker container, built using the provided\n[Dockerfile](https://github.com/googleads/google-ads-perl/blob/HEAD/Dockerfile) and\n[docker-compose.yml](https://github.com/googleads/google-ads-perl/blob/HEAD/docker-compose.yml).\n\nTo do so (provided that you have a Docker environment\n[installed](//docs.docker.com/install/)), run the following command in the\ndirectory where you cloned this repository: \n\n docker-compose up --build -d\n\nThis will provide a Docker container instance with the execution environment set\nup.\n\nTo open a Bash shell inside the Docker container, run `docker ps` to get\nthe container ID, then run: \n\n docker exec -it \u003cYOUR_CONTAINER_ID\u003e bash\n\nThis will allow you to run code examples and other applications inside the\ncontainer.\n\nAs a shorthand, in case you only have a single Docker container running on your\nmachine, you can also run: \n\n docker exec -it $(docker ps -a -q) bash"]]