Run in a Docker container

  • Execute and develop Google Ads API applications within a Docker container built using provided files.

  • Set up the Docker container execution environment by running docker-compose up --build -d.

  • Access a Bash shell inside the Docker container using docker exec -it <YOUR_CONTAINER_ID> bash or a shorthand command if only one container is running.

  • Run code examples and other applications inside the Docker container once a Bash shell is open.

You can execute code examples and develop your Google Ads API application inside a Docker container built using the provided Dockerfile and docker-compose.yml.

Prerequisites

Before starting, install Docker on your machine.

Start the container

To build and start the Docker container instance in the background, run the following command in the directory where you cloned the repository:

docker compose up --build -d

This provides a Docker container instance with the execution environment set up.

Access the container shell

To open a Bash shell inside the running container, run docker ps to get the container ID, then run:

docker exec -it <CONTAINER_ID> bash

Alternatively, if you started the container using Docker Compose, you can run docker compose exec with the service name defined in docker-compose.yml (web):

docker compose exec web bash

This lets you run code examples and other scripts inside the interactive container shell.

Stop the container

To stop and remove the running container instances, run:

docker compose down