Docker - open-telemetry/opentelemetry-demo

Docker is a popular open-source platform for developing, shipping, and running applications inside containers. It allows for consistent deployment and scaling of applications, regardless of the underlying infrastructure. The OpenTelemetry demo project (https://github.com/open-telemetry/opentelemetry-demo/) uses Docker for deployment. Here are the steps to build and push Docker images using the Makefile function in this project.

  1. Prerequisites:
  • Docker
  • Docker Compose v2.0.0+
  • Make (optional)
  • 6 GB of RAM for the application
  1. Get and run the demo:
  • Clone the Demo repository: git clone https://github.com/open-telemetry/opentelemetry-demo.git
  • Change to the demo folder: cd opentelemetry-demo/
  • Use make to start the demo: make start
  • Alternatively, you can use docker compose up --force-recreate --remove-orphans --detach 1
  1. Dockerfile:
  • The Dockerfile for the demo project is located in the root directory.
  • It uses the open-telemetry/opentelemetry-demo base image and installs necessary dependencies.
  • The entrypoint script runs the demo application.
  1. Docker Compose:
  • The docker-compose.yml file is used to define and run multi-container Docker applications.
  • It includes services for the demo application, OpenTelemetry Collector, Jaeger, and Grafana.
  1. Building and pushing Docker images:
  • The Makefile in the project includes a build-image target to build the Docker image.
  • To build the image, run make build-image.
  • To push the image to a Docker registry, tag the image with the registry name and push it using docker push.

Example:

To push the Docker image to Docker Hub:

  1. Tag the image: docker tag opentelemetry-demo <your-dockerhub-username>/opentelemetry-demo
  2. Push the image: docker push <your-dockerhub-username>/opentelemetry-demo

Sources: