6 Commits

Author SHA1 Message Date
github-actions[bot]
712d64e484 auto update README.md 2025-04-28 09:03:23 +00:00
ElevenNotes
1c78ef6e04 [feature] add comparison 2025-04-28 10:58:10 +02:00
ElevenNotes
78cede6065 Merge branch 'master' of https://github.com/11notes/docker-nginx 2025-04-25 12:03:23 +02:00
ElevenNotes
afa5804ed0 [upgrade] latest workflow version 2025-04-25 12:03:14 +02:00
ElevenNotes
e8ee749190 [upgrade] 1.28.0 2025-04-25 12:02:47 +02:00
github-actions[bot]
94edc7d7f3 auto update README.md 2025-04-14 06:54:34 +00:00
6 changed files with 171 additions and 32 deletions

View File

@@ -175,6 +175,11 @@ jobs:
core.exportVariable('WORKFLOW_CREATE_README', (opt.input?.readme === undefined) ? false : opt.input.readme);
core.exportVariable('WORKFLOW_GRYPE_FAIL_ON_SEVERITY', (opt.dot?.grype?.fail === undefined) ? true : opt.dot.grype.fail);
core.exportVariable('WORKFLOW_GRYPE_SEVERITY_CUTOFF', (opt.dot?.grype?.severity || 'high'));
if(opt.dot?.readme?.comparison){
core.exportVariable('WORKFLOW_CREATE_COMPARISON', true);
core.exportVariable('WORKFLOW_CREATE_COMPARISON_FOREIGN_IMAGE', opt.dot.readme.comparison.image);
core.exportVariable('WORKFLOW_CREATE_COMPARISON_IMAGE', `${docker.image.name}:${docker.app.version}`);
}
@@ -333,10 +338,20 @@ jobs:
# README
- name: github / checkout master
- name: github / checkout HEAD
continue-on-error: true
run: |
git checkout master
run: |
git checkout HEAD
- name: docker / setup comparison images
if: env.WORKFLOW_CREATE_COMPARISON == 'true'
continue-on-error: true
run: |
docker image pull ${{ env.WORKFLOW_CREATE_COMPARISON_IMAGE }}
docker image pull ${{ env.WORKFLOW_CREATE_COMPARISON_FOREIGN_IMAGE }}
docker image ls --filter "reference=${{ env.WORKFLOW_CREATE_COMPARISON_IMAGE }}" --format json | jq --raw-output '.Size' &> ./comparison.size0.log
docker image ls --filter "reference=${{ env.WORKFLOW_CREATE_COMPARISON_FOREIGN_IMAGE }}" --format json | jq --raw-output '.Size' &> ./comparison.size1.log
docker run --entrypoint "/bin/sh" --rm ${{ env.WORKFLOW_CREATE_COMPARISON_FOREIGN_IMAGE }} -c id &> ./comparison.id.log
- name: github / create README.md
id: github-readme
@@ -392,7 +407,7 @@ jobs:
git add LICENSE
fi
git commit -m "auto update README.md"
git push
git push origin HEAD:master

9
.json
View File

@@ -5,9 +5,9 @@
"arch":"linux/amd64,linux/arm64,linux/arm/v7",
"semver":{
"version":"1.26.3",
"stable":"1.26.3",
"latest":"1.26.3"
"version":"1.28.0",
"stable":"1.28.0",
"latest":"1.28.0"
},
"readme":{
@@ -20,6 +20,9 @@
"11notes/distroless",
"11notes/distroless:curl"
]
},
"comparison":{
"image":"nginx:1.28.0-alpine-slim"
}
}
}

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020 11notes
Copyright (c) 2025 11notes
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

163
README.md
View File

@@ -1,49 +1,163 @@
![banner](https://github.com/11notes/defaults/blob/main/static/img/banner.png?raw=true)
# ⛰️ nginx
[<img src="https://img.shields.io/badge/github-source-blue?logo=github&color=040308">](https://github.com/11notes/docker-nginx)![size](https://img.shields.io/docker/image-size/11notes/nginx/1.26.3?color=0eb305)![version](https://img.shields.io/docker/v/11notes/nginx/1.26.3?color=eb7a09)![pulls](https://img.shields.io/docker/pulls/11notes/nginx?color=2b75d6)[<img src="https://img.shields.io/github/issues/11notes/docker-nginx?color=7842f5">](https://github.com/11notes/docker-nginx/issues)
# NGINX
[<img src="https://img.shields.io/badge/github-source-blue?logo=github&color=040308">](https://github.com/11notes/docker-NGINX)![5px](https://github.com/11notes/defaults/blob/main/static/img/transparent5x2px.png?raw=true)![size](https://img.shields.io/docker/image-size/11notes/nginx/1.28.0?color=0eb305)![5px](https://github.com/11notes/defaults/blob/main/static/img/transparent5x2px.png?raw=true)![version](https://img.shields.io/docker/v/11notes/nginx/1.28.0?color=eb7a09)![5px](https://github.com/11notes/defaults/blob/main/static/img/transparent5x2px.png?raw=true)![pulls](https://img.shields.io/docker/pulls/11notes/nginx?color=2b75d6)![5px](https://github.com/11notes/defaults/blob/main/static/img/transparent5x2px.png?raw=true)[<img src="https://img.shields.io/github/issues/11notes/docker-NGINX?color=7842f5">](https://github.com/11notes/docker-NGINX/issues)![5px](https://github.com/11notes/defaults/blob/main/static/img/transparent5x2px.png?raw=true)![swiss_made](https://img.shields.io/badge/Swiss_Made-FFFFFF?labelColor=FF0000&logo=data:image/svg%2bxml;base64,PHN2ZyB2ZXJzaW9uPSIxIiB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iI2YwMCIvPjxwYXRoIGQ9Im0xMyA2aDZ2N2g3djZoLTd2N2gtNnYtN2gtN3YtNmg3eiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==)
Nginx with additional plugins and custom compiled
Nginx, slim and distroless to be used behind a reverse proxy or as full version
# MAIN TAGS 🏷️
These are the main tags for the image. There is also a tag for each commit and its shorthand sha256 value.
* [1.26.3](https://hub.docker.com/r/11notes/nginx/tags?name=1.26.3)
* [1.28.0](https://hub.docker.com/r/11notes/nginx/tags?name=1.28.0)
* [stable](https://hub.docker.com/r/11notes/nginx/tags?name=stable)
* [latest](https://hub.docker.com/r/11notes/nginx/tags?name=latest)
* [1.26.3-unraid](https://hub.docker.com/r/11notes/nginx/tags?name=1.26.3-unraid)
* [stable-unraid](https://hub.docker.com/r/11notes/nginx/tags?name=stable-unraid)
* [latest-unraid](https://hub.docker.com/r/11notes/nginx/tags?name=latest-unraid)
# UNRAID VERSION 🟠
This image supports unraid by default. Simply add **-unraid** to any tag and the image will run as 99:100 instead of 1000:1000 causing no issues on unraid. Enjoy.
# REPOSITORIES ☁️
```
docker pull 11notes/nginx:1.28.0
docker pull ghcr.io/11notes/nginx:1.28.0
docker pull quay.io/11notes/nginx:1.28.0
```
# SYNOPSIS 📖
**What can I do with this?** What can I do with this? This image will serve as a base for nginx related images that need a high-performance webserver. It can also be used stand alone as a webserver or reverse proxy. It will automatically reload on config changes if configured.
**What can I do with this?** This image will serve as a base for nginx related images that need a high-performance webserver. The default tag of this image is stripped for most functions that can be used by a reverse proxy in front of nginx, it adds however important webserver functions like brotli compression. The default tag is not meant to run as a reverse proxy, use the full image for that. The default tag does not support HTTPS for instance!
# UNIQUE VALUE PROPOSITION 💶
**Why should I run this image and not the other image(s) that already exist?** Good question! All the other images on the market that do exactly the same dont do or offer these options:
> [!IMPORTANT]
>* This image runs as 1000:1000 by default, most other images run everything as root
>* This image has no shell since it is 100% distroless, most other images run on a distro like Debian or Alpine with full shell access (security)
>* This image does not ship with any critical or high rated CVE and is automatically maintained via CI/CD, most other images mostly have no CVE scanning or code quality tools in place
>* This image is created via a secure, pinned CI/CD process and immune to upstream attacks, most other images have upstream dependencies that can be exploited
>* This image contains a proper health check that verifies the app is actually working, most other images have either no health check or only check if a port is open or ping works
>* This image works as read-only, most other images need to write files to the image filesystem
>* This image is a lot smaller than most other images
If you value security, simplicity and the ability to interact with the maintainer and developer of an image. Using my images is a great start in that direction.
# COMPARISON 🏁
Below you find a comparison between this image and the most used one.
| **image**![128px](https://github.com/11notes/defaults/blob/main/static/img/transparent128x1px.png?raw=true) | 11notes/nginx:1.28.0 | nginx:1.28.0-alpine-slim |
| ---: | :---: | :---: |
| **image size on disk** | 4.4MB | 11.9MB |
| **process UID/GID** | 1000/1000 | 0:0 |
| **distroless?** | ✅ | ❌ |
# DEFAULT CONFIG 📑
```yaml
worker_processes auto;
worker_cpu_affinity auto;
worker_rlimit_nofile 204800;
error_log /nginx/log/error.log warn;
daemon off;
events {
worker_connections 1024;
use epoll;
multi_accept on;
}
http {
log_format main escape=json '{"log":"main","time":"$time_iso8601","server":{"name":"$server_name", "protocol":"$server_protocol"}, "client":{"ip":"$remote_addr", "x-forwarded-for":"$http_x_forwarded_for", "user":"$remote_user"},"request":{"method":"$request_method", "url":"$request_uri", "time":"$request_time", "status":$status}}';
log_format proxy escape=json '{"log":"proxy", "time":"$time_iso8601","server":{"name":"$server_name", "protocol":"$server_protocol"}}, "client":{"ip":"$remote_addr", "x-forwarded-for":"$http_x_forwarded_for", "user":"$remote_user"},"request":{"method":"$request_method", "url":"$request_uri", "time":"$request_time", "status":$status}, "proxy":{"host":"$upstream_addr", "time":{"connect":"$upstream_connect_time", "response":"$upstream_response_time", "header":"$upstream_header_time"}, "io":{"bytes":{"sent":"$upstream_bytes_sent", "received":"$upstream_bytes_received"}}, "cache":"$upstream_cache_status", "status":"$upstream_status"}}';
access_log off;
server_tokens off;
include mime.types;
default_type application/octet-stream;
sendfile on;
aio on;
tcp_nopush on;
tcp_nodelay on;
gzip on;
brotli on;
brotli_comp_level 4;
brotli_static on;
brotli_types
text/plain
text/css
text/xml
text/javascript
text/x-component
application/xml
application/xml+rss
application/javascript
application/json
application/atom+xml
application/vnd.ms-fontobject
application/x-font-ttf
application/x-font-opentype
application/x-font-truetype
application/x-web-app-manifest+json
application/xhtml+xml
application/octet-stream
font/opentype
font/truetype
font/eot
font/otf
image/svg+xml
image/x-icon
image/vnd.microsoft.icon
image/bmp;
client_max_body_size 8M;
keepalive_timeout 90;
keepalive_requests 102400;
reset_timedout_connection on;
client_body_timeout 10;
send_timeout 5;
open_file_cache max=204800 inactive=5m;
open_file_cache_valid 2m;
open_file_cache_min_uses 2;
open_file_cache_errors off;
root /nginx/var;
include /nginx/etc/*.conf;
}
```
The default configuration contains no special settings. It enables brotli compression, sets the workers to the same amount as n-CPUs available, has two default logging formats, disables most stuff not needed and enables best performance settings. Please mount your own config if you need to change how nginx is setup.
# VOLUMES 📁
* **/nginx/etc** - Directory of vHost config, must end in *.conf (set in /etc/nginx/nginx.conf)
* **/nginx/etc** - Directory of vHost config, must end in *.conf
* **/nginx/var** - Directory of webroot for vHost
# COMPOSE ✂️
```yaml
name: "nginx"
services:
nginx:
image: "11notes/nginx:1.26.2"
container_name: "nginx"
image: "11notes/nginx:1.28.0"
read_only: true
environment:
TZ: "Europe/Zurich"
ports:
- "8443:8443/tcp"
- "3000:3000/tcp"
networks:
frontend:
volumes:
- "etc:/nginx/etc"
- "var:/nginx/var"
- "ssl:/nginx/ssl"
tmpfs:
- "/nginx/cache:uid=1000,gid=1000"
- "/nginx/run:uid=1000,gid=1000"
restart: "always"
volumes:
etc:
var:
ssl:
networks:
frontend:
```
# DEFAULT SETTINGS 🗃️
@@ -59,23 +173,26 @@ volumes:
| --- | --- | --- |
| `TZ` | [Time Zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) | |
| `DEBUG` | Will activate debug option for container image and app (if available) | |
| `NGINX_DYNAMIC_RELOAD` | Enable reload of nginx on configuration changes in /nginx/etc (only on successful configuration test!) | |
| `NGINX_HEALTHCHECK_URL` | URL to check if nginx is ready to accept connections | https://localhost:8443/ping |
# SOURCE 💾
* [11notes/nginx](https://github.com/11notes/docker-nginx)
* [11notes/nginx](https://github.com/11notes/docker-NGINX)
# PARENT IMAGE 🏛️
* [11notes/alpine:stable](https://hub.docker.com/r/11notes/alpine)
> [!IMPORTANT]
>This image is not based on another image but uses [scratch](https://hub.docker.com/_/scratch) as the starting layer.
>The image consists of the following distroless layers that were added:
>* [11notes/distroless](https://github.com/11notes/docker-distroless/blob/master/arch.dockerfile) - contains users, timezones and Root CA certificates
>* [11notes/distroless:curl](https://github.com/11notes/docker-distroless/blob/master/curl.dockerfile) - app to execute HTTP or UNIX requests
# BUILT WITH 🧰
* [nginx](https://nginx.org)
# GENERAL TIPS 📌
* Use a reverse proxy like Traefik, Nginx, HAproxy to terminate TLS and to protect your endpoints
* Use Lets Encrypt DNS-01 challenge to obtain valid SSL certificates for your services
> [!TIP]
>* Use a reverse proxy like Traefik, Nginx, HAproxy to terminate TLS and to protect your endpoints
>* Use Lets Encrypt DNS-01 challenge to obtain valid SSL certificates for your services
# ElevenNotes™
This image is provided to you at your own risk. Always make backups before updating an image to a different version. Check the [releases](https://github.com/11notes/docker-nginx/releases) for breaking changes. If you have any problems with using this image simply raise an [issue](https://github.com/11notes/docker-nginx/issues), thanks. If you have a question or inputs please create a new [discussion](https://github.com/11notes/docker-nginx/discussions) instead of an issue. You can find all my other repositories on [github](https://github.com/11notes?tab=repositories).
*created 11.3.2025, 07:50:49 (CET)*
*created 28.04.2025, 11:03:22 (CET)*

View File

@@ -1,7 +1,7 @@
name: "nginx"
services:
nginx:
image: "11notes/nginx:1.26.3"
image: "11notes/nginx:1.28.0"
read_only: true
environment:
TZ: "Europe/Zurich"

View File

@@ -9,9 +9,13 @@ ${{ github:> }}* This image does not ship with any critical or high rated CVE an
${{ github:> }}* This image is created via a secure, pinned CI/CD process and immune to upstream attacks, most other images have upstream dependencies that can be exploited
${{ github:> }}* This image contains a proper health check that verifies the app is actually working, most other images have either no health check or only check if a port is open or ping works
${{ github:> }}* This image works as read-only, most other images need to write files to the image filesystem
${{ github:> }}* This image is a lot smaller than most other images
If you value security, simplicity and the ability to interact with the maintainer and developer of an image. Using my images is a great start in that direction.
${{ content_comparison }}
${{ title_config }}
```yaml
${{ include: ./rootfs/etc/nginx/nginx.conf }}