Skip to content

A super-compact HTTP 404 container.

License

Notifications You must be signed in to change notification settings

Aeron/404-container

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

404 Container

It’s a super-compact container with the sole purpose of responding with HTTP 404. And it’s written in Rust and async-std.

Motivation

It mainly exists because I wanted a tiny-tiny performant default back-end for my HAProxy Ingress Kubernetes deployments.

The usual default k8s.gcr.io/defaultbackend-amd64 does not fit the bill quite well to my taste. Especially when its arm64 variant gives you a platform mismatch error, declaring the image’s platform is linux/amd64.

(At least, it has been doing it at the moment of writing this. Who knows why—it’s four years old.)

Also, there may be a room or a requirement for customization or extra configurability.

Usage

The container image is available as docker.io/aeron/404 and ghcr.io/Aeron/404. You can use both interchangeably.

docker pull docker.io/aeron/404
# …or…
docker pull ghcr.io/aeron/404

Container Running

Running a container is pretty straightforward:

docker -d --restart unless-stopped --name http-404 \
    --user=65534 \
    -p 80/8080:tcp \
    docker.io/aeron/404

By default, the containerized app listens on the 0.0.0.0:8080 address.

However, you can also provide the PORT environment variable with a desired port number value. Just like so:

docker -d --restart unless-stopped --name http-404 \
    --user=65534 \
    -e PORT=1080 \
    -p 80/1080:tcp \
    docker.io/aeron/404

Don’t forget about the unprivileged user trick. The container itself won’t enforce any specific UID.