Skip to content

Commit b54e1ad

Browse files
KingPinKingPin
authored andcommitted
docs(readme): fix inaccuracies and remove stale content
- Clarify env vars are v2 only (s6 init applies them) - Fix security section: appuser is v2 only, v1 runs as root - Update architecture diagram: remove bullseye, show v1/v2 split - Fix stale bullseye redirect note with accurate v1/v2 base OS info - Remove BuildKit as a pro/con (it's now the Docker default) - Fix docker-compose to Docker Compose - Note dev dependency cleanup in image sizes - Replace inline license with reference to LICENSE file
1 parent 55257f6 commit b54e1ad

1 file changed

Lines changed: 55 additions & 79 deletions

File tree

README.md

Lines changed: 55 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ See [v1 vs v2 comparison](#v1-vs-v2-comparison) below for details.
2828

2929
> **ℹ️ Base OS Update (v2 only)**: v2 Debian images now use **Debian Trixie** as the base OS (following upstream PHP official images). For backward compatibility, `:bookworm` tags continue to work and point to the same Trixie-built images. v1 images remain on Bookworm. [See migration notes](docs/migration.md#debian-trixie-migration-v2-only) for details.
3030
31-
## Environment Variables
31+
## Environment Variables (v2 only)
3232

33-
The following environment variables can be overridden when running containers:
33+
The following environment variables are applied at container startup by the s6-overlay init script in **v2 images only**. v1 images do not process these variables.
3434

3535
### Memory Settings
3636

@@ -75,7 +75,7 @@ The following environment variables can be overridden when running containers:
7575
### Example usage
7676

7777
```bash
78-
docker run -e PHP_MEMORY_LIMIT=512M -e PHP_MAX_EXECUTION_TIME=600 kingpin/php-docker:8.3-fpm-alpine
78+
docker run -e PHP_MEMORY_LIMIT=512M -e PHP_MAX_EXECUTION_TIME=600 kingpin/php-docker:8.3-fpm-alpine-v2
7979
```
8080

8181
## 🚀 Quick Start
@@ -118,15 +118,13 @@ We maintain **two image variants** to support both existing users and modern use
118118

119119
- Simpler Dockerfile with fewer runtime layers
120120
- No s6-overlay or external init system
121-
- Builds with standard `docker build` (no BuildKit required)
122-
- Smaller image footprint in some configurations
121+
- Smaller image footprint
123122

124123
**Pros:**
125124

126-
✅ Drop-in replacement for existing deployments
127-
✅ Simpler container runtime behavior
128-
✅ Smaller learning curve
129-
✅ No BuildKit dependency for local builds
125+
✅ Drop-in replacement for existing deployments
126+
✅ Simpler container runtime behavior
127+
✅ Smaller learning curve
130128

131129
**Cons:**
132130

@@ -151,22 +149,21 @@ We maintain **two image variants** to support both existing users and modern use
151149
- Uses [s6-overlay](https://github.com/just-containers/s6-overlay) as PID 1 init
152150
- Proper signal handling and zombie process reaping
153151
- Service supervision and restart policies
154-
- BuildKit-enabled for better build performance and caching
155152
- Built on Debian Trixie (`:trixie` tags) with `:bookworm` compatibility aliases
156153

157154
**Pros:**
158155

159-
✅ Proper PID 1 and process supervision (s6)
160-
✅ Safe for running FPM + sidecar processes (e.g., cron, queue workers)
161-
✅ Better build performance with BuildKit cache mounts
162-
✅ Easier to add background services and health checks
156+
✅ Proper PID 1 and process supervision (s6)
157+
✅ Safe for running FPM + sidecar processes (e.g., cron, queue workers)
158+
✅ Environment-based PHP config at runtime
159+
✅ Non-root user (appuser, UID 1000) by default
160+
✅ Easier to add background services and health checks
163161
✅ Handles container signals properly
164162

165163
**Cons:**
166164

167-
❌ Requires Docker BuildKit/buildx for advanced features
168-
❌ Slightly larger image due to s6-overlay (~2-3MB)
169-
❌ Different runtime behavior may require minor adjustments
165+
❌ Slightly larger image due to s6-overlay (~2-3MB)
166+
❌ Different runtime behavior may require minor adjustments
170167
❌ More complex init system to understand
171168

172169
**Use v2 when:**
@@ -211,9 +208,9 @@ For more details, see [docs/ci.md](docs/ci.md).
211208

212209
These images are designed with security in mind:
213210

214-
- **Non-root User**: Containers run as a non-root `appuser` (UID 1000) by default
215-
- **Limited Permissions**: `/var/www/html` directory has appropriate permissions
216-
- **Security Updates**: Images are regularly scanned for vulnerabilities
211+
- **Non-root User (v2)**: v2 containers include a non-root `appuser` (UID 1000). v1 images run as the base PHP image default (root)
212+
- **Limited Permissions (v2)**: `/var/www/html` directory has appropriate ownership and permissions
213+
- **Security Updates**: Images are regularly scanned for vulnerabilities via Trivy
217214

218215
### Security Best Practices
219216

@@ -335,7 +332,7 @@ Both v1 and v2 variants are available for all combinations below:
335332
| 8.2 | FPM | Bookworm | `8.2-fpm-bookworm` | `8.2-fpm-bookworm-v2` |
336333
| 8.2 | Apache | Bookworm | `8.2-apache-bookworm` | `8.2-apache-bookworm-v2` |
337334

338-
> **Note:** PHP 8.1+ images are built on Bookworm (Debian 12). Bullseye tags redirect to Bookworm for PHP 8.1+.
335+
> **Note:** v1 Debian images use Bookworm. v2 Debian images use Trixie, with `:bookworm-v2` tags as compatibility aliases pointing to the same Trixie-built images.
339336
340337
### Deprecated Tags (v1 only)
341338

@@ -360,17 +357,17 @@ The following tags are deprecated and will not be built going forward, but remai
360357
361358
## 📊 Image Sizes
362359

363-
Approximate compressed sizes (v1 / v2):
360+
Approximate compressed sizes (vary by PHP version and platform):
364361

365-
| Type | OS | v1 Size | v2 Size | Delta |
366-
|--------|-----------|---------|----------|----------|
367-
| CLI | Alpine | ~80MB | ~83MB | +3MB |
368-
| CLI | Bookworm | ~140MB | ~143MB | +3MB |
369-
| FPM | Alpine | ~85MB | ~88MB | +3MB |
370-
| FPM | Bookworm | ~150MB | ~153MB | +3MB |
371-
| Apache | Bookworm | ~180MB | ~183MB | +3MB |
362+
| Type | OS | v1 Size | v2 Size |
363+
|--------|-----------|---------|----------|
364+
| CLI | Alpine | ~80MB | ~83MB |
365+
| CLI | Bookworm | ~140MB | ~143MB |
366+
| FPM | Alpine | ~85MB | ~88MB |
367+
| FPM | Bookworm | ~150MB | ~153MB |
368+
| Apache | Bookworm | ~180MB | ~183MB |
372369

373-
> v2 overhead is primarily the s6-overlay binaries (~2-3MB per image).
370+
> v2 overhead is primarily the s6-overlay binaries (~2-3MB). Build dependencies are cleaned up to minimize image size.
374371
375372
## Pre-installed PHP Extensions
376373

@@ -425,7 +422,7 @@ Approximate compressed sizes (v1 / v2):
425422
docker run -d --name php-app kingpin/php-docker:8.3-cli-alpine php -v
426423
```
427424

428-
### With docker-compose
425+
### With Docker Compose
429426

430427
```yaml
431428
services:
@@ -487,29 +484,32 @@ The following PHP versions are **no longer actively built** but remain available
487484

488485
## 🏗️ Architecture Diagram
489486
```
490-
┌───────────────┐
491-
│ Base Image │
492-
│ php:X.Y │
493-
└───────┬───────┘
494-
495-
┌─────────────┼─────────────┐
496-
│ │ │
497-
┌─────────▼────┐ ┌──────▼─────┐ ┌─────▼──────┐
498-
│ Alpine OS │ │ Bullseye OS│ │ Bookworm OS│
499-
└─────────┬────┘ └──────┬─────┘ └─────┬──────┘
500-
│ │ │
501-
┌─────────▼────┐ ┌──────▼─────┐ ┌─────▼──────┐
502-
│ Extensions & │ │ Extensions │ │Extensions &│
503-
│ Libraries │ │ Libraries │ │ Libraries │
504-
└─────────┬────┘ └──────┬─────┘ └─────┬──────┘
505-
│ │ │
506-
└─────────────┼─────────────┘
507-
508-
┌──────────┼──────────┐
509-
│ │ │
510-
┌──────▼───┐ ┌────▼────┐ ┌───▼─────┐
511-
│ CLI │ │ FPM │ │ Apache │
512-
└──────────┘ └─────────┘ └─────────┘
487+
┌───────────────┐
488+
│ Base Image │
489+
│ php:X.Y-... │
490+
└───────┬───────┘
491+
492+
┌─────────────┴─────────────┐
493+
│ │
494+
┌──────▼──────┐ ┌───────▼───────┐
495+
│ v1 │ │ v2 │
496+
│ (simple) │ │ (s6-overlay) │
497+
└──────┬──────┘ └───────┬───────┘
498+
│ │
499+
┌───────┼───────┐ ┌────────┼────────┐
500+
│ │ │ │
501+
Alpine Bookworm Alpine Trixie
502+
│ │ │ (bookworm
503+
│ │ │ compat)
504+
└───────┬───────┘ └────────┬────────┘
505+
│ │
506+
└─────────┬─────────────────┘
507+
508+
┌──────────┼──────────┐
509+
│ │ │
510+
┌──────▼───┐ ┌────▼────┐ ┌───▼─────┐
511+
│ CLI │ │ FPM │ │ Apache │
512+
└──────────┘ └─────────┘ └─────────┘
513513
```
514514

515515
## Contributing
@@ -536,31 +536,7 @@ Our CI/CD pipeline will automatically test your changes when you submit a PR.
536536

537537
## License
538538

539-
This project is licensed under the MIT License - see below for details:
540-
541-
```
542-
MIT License
543-
544-
Copyright (c) 2023 Kingpin
545-
546-
Permission is hereby granted, free of charge, to any person obtaining a copy
547-
of this software and associated documentation files (the "Software"), to deal
548-
in the Software without restriction, including without limitation the rights
549-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
550-
copies of the Software, and to permit persons to whom the Software is
551-
furnished to do so, subject to the following conditions:
552-
553-
The above copyright notice and this permission notice shall be included in all
554-
copies or substantial portions of the Software.
555-
556-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
557-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
558-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
559-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
560-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
561-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
562-
SOFTWARE.
563-
```
539+
This project is licensed under the MIT License - see [LICENSE](LICENSE) for details.
564540

565541
---
566542

0 commit comments

Comments
 (0)