Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aeron/404-container
A super-compact HTTP 404 container.
https://github.com/aeron/404-container
404 container-image default-backend docker-image
Last synced: 7 days ago
JSON representation
A super-compact HTTP 404 container.
- Host: GitHub
- URL: https://github.com/aeron/404-container
- Owner: Aeron
- License: isc
- Created: 2022-11-01T20:24:51.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-18T20:55:30.000Z (11 months ago)
- Last Synced: 2024-04-24T03:40:19.018Z (8 months ago)
- Topics: 404, container-image, default-backend, docker-image
- Language: Rust
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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`][docker] and
[`ghcr.io/Aeron/404`][github]. You can use both interchangeably.```sh
docker pull docker.io/aeron/404
# …or…
docker pull ghcr.io/aeron/404
```[docker]: https://hub.docker.com/r/aeron/404
[github]: https://github.com/Aeron/404-container/pkgs/container/404### Container Running
Running a container is pretty straightforward:
```sh
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:```sh
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.