infrastructureascode/hello-world

By infrastructureascode

Updated 5 months ago

A tiny "Hello World" web server with a health check endpoint.

Image
1

500K+

infrastructureascode/hello-world repository overview

GHCR Build Status Docker Hub Build Status

ghcr.io/infrastructure-as-code/hello-world

A Prometheus-instrumented Docker "Hello World" web server. This image began life as infrastructureascode/hello-world on Docker Hub, and is now also available on the GitHub Container Registry as ghcr.io/infrastructure-as-code/hello-world.

Images

Registry NameImage Name
GitHub Container Registryghcr.io/infrastructure-as-code/hello-world
Docker Hubinfrastructureascode/hello-world

Features

  1. Always returns a HTTP 200 status code and a "Hello, World!" message at the / path.
  2. Has a metrics endpoint at /metrics that returns Prometheus metrics.
  3. Has a health check endpoint, /health, that returns an empty response and a HTTP 200 response.

Building

docker build --rm -t ghcr.io/infrastructure-as-code/hello-world .

Releases

Images are built with GitHub Actions upon tagging/push, and pushed directly to the GitHub Container Registry. You can look at the packages page for the latest tagged version.

Additionally, the sha1sum of the binary in each image is emitted during the build process (look for "Show binary info") in the build logs in case provenance is a concern.

Usage

# start the container
docker run \
  --detach \
  --name hello-world \
  --publish 8000:8080 \
  ghcr.io/infrastructure-as-code/hello-world

# curl the container
curl http://0.0.0.0:8000/

# curl the health check endpoint which returns an empty response
curl http://0.0.0.0:8000/health

# curl Prometheus metrics
curl http://0.0.0.0:8000/metrics

Tag summary

Content type

Image

Digest

sha256:7ac6fbf24

Size

9.2 MB

Last updated

about 3 years ago

docker pull infrastructureascode/hello-world:2.4.0