Step 11 – Start the API Gateway Analytics Docker container

Use the docker run command to start the API Gateway Analytics container. For example:

$ docker run -it --name=analytics -p 8040:8040 --network=api-gateway-domain
-v /tmp/reports:/tmp/reports
-e METRICS_DB_URL=jdbc:mysql://metricsdb:3306/metrics?useSSL=false
-e METRICS_DB_USERNAME=root -e METRICS_DB_PASS=root01
apigw-analytics:latest

This example performs the following:

  • Starts an API Gateway Analytics container named analytics from an image named apigw-analytics:latest. You must specify the name of the API Gateway Analytics Docker image that you created in Step 10 – Create an API Gateway Analytics Docker image.
  • Binds the port 8040 of the container to port 8040 on the host machine. This enables you to access the API Gateway Analytics web UI on port 8040 of your host machine.
  • Mounts the host directory /tmp/reports inside the container to store API Gateway Analytics reports.
  • Uses environment variables to specify connection details for the metrics database. The metrics database must be running as detailed in Step 3 – Start external data stores.

To run the container in the background, use the -d option, for example:

$ docker run -d --name=analytics -p 8040:8040 --network=api-gateway-domain
-v /tmp/reports:/tmp/reports
-e METRICS_DB_URL=jdbc:mysql://metricsdb:3306/metrics?useSSL=false
-e METRICS_DB_USERNAME=root -e METRICS_DB_PASS=root01
apigw-analytics:latest

Related Links