Running in a Docker Container
Stay organized with collections
Save and categorize content based on your preferences.
You can also execute the examples and develop your Google Ads API application
inside a Docker container, built using the provided
Dockerfile and
docker-compose.yml.
To do so (provided that you have a Docker environment
installed), run the following command in the
directory where you cloned this repository:
docker-compose up --build -d
This will provide a Docker container instance with all the required dependencies
already installed.
To open a BASH shell inside the Docker container, you can run docker ps
to get
the container ID and then run:
docker exec -it <YOUR_CONTAINER_ID> bash
This will allow you to run code examples and other applications inside the
container.
As a shorthand, in case you only have a single Docker container running on your
machine, you can also run:
docker exec -it $(docker ps -a -q) bash
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-25 UTC.
[null,null,["Last updated 2025-08-25 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"]]