פעילות בקונטיינר ב-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 Docker for seamless execution of Google Ads API examples and application development within a pre-built environment.\u003c/p\u003e\n"],["\u003cp\u003eInitiate the Docker environment using \u003ccode\u003edocker-compose up --build -d\u003c/code\u003e after cloning the repository.\u003c/p\u003e\n"],["\u003cp\u003eAccess a BASH shell within the Docker container via \u003ccode\u003edocker exec -it <YOUR_CONTAINER_ID> bash\u003c/code\u003e to interact with code samples and applications.\u003c/p\u003e\n"],["\u003cp\u003eLeverage \u003ccode\u003edocker exec -it $(docker ps -a -q) bash\u003c/code\u003e as a shortcut for accessing the container when only one is running.\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-php/blob/HEAD/Dockerfile) and\n[docker-compose.yml](https://github.com/googleads/google-ads-php/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 all the required dependencies\nalready installed.\n\nTo open a BASH shell inside the Docker container, you can run `docker ps` to get\nthe container ID and 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"]]