docker-base-images-knowledge
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "docker-base-images-knowledge" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-f786bba1ba139f805fecd089c1874bbd574e746e7c8dbb855dcbeca067192679. Verify the upstream source and version against https://github.com/dykyi-roman/awesome-claude-code before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
PHP Docker base images knowledge base: provides guidance for image selection, a comparison of Alpine versus Debian, and strategies for version pinning, for reference when building and reviewing base images.
Introduction source: third_party · dykyi-roman · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Docker base images knowledge base for PHP. Provides image selection guidelines, Alpine vs Debian comparison, and version pinning strategies.
- Testing
- Not tested
Browse files
Frontmatter
name: docker-base-images-knowledge
description: Docker base images knowledge base for PHP. Provides image selection guidelines, Alpine vs Debian comparison, and version pinning strategies.Docker Base Images Knowledge Base for PHP
Guidelines for selecting and managing PHP Docker base images.
PHP Official Images Overview
| Image Tag Pattern | Base OS | Size | Use Case |
|---|---|---|---|
php:8.4-fpm |
Debian Bookworm | ~480MB | Production FPM (full compatibility) |
php:8.4-fpm-alpine |
Alpine 3.20 | ~80MB | Production FPM (minimal size) |
php:8.4-cli |
Debian Bookworm | ~450MB | CLI scripts, cron jobs, workers |
php:8.4-cli-alpine |
Alpine 3.20 | ~50MB | Lightweight CLI tasks |
php:8.4-apache |
Debian Bookworm | ~500MB | All-in-one Apache+PHP |
php:8.4-zts |
Debian Bookworm | ~460MB | Thread-safe (parallel ext) |
php:8.4-zts-alpine |
Alpine 3.20 | ~85MB | Thread-safe minimal |
Alpine vs Debian Comparison
┌─────────────────────────────────────────────────────────────────────────────┐
│ ALPINE vs DEBIAN FOR PHP CONTAINERS │
├────────────────────┬────────────────────────┬───────────────────────────────┤
│ Criterion │ Alpine (musl) │ Debian (glibc) │
├────────────────────┼────────────────────────┼───────────────────────────────┤
│ Image Size │ ~80MB (FPM) │ ~480MB (FPM) │
│ C Library │ musl libc │ glibc │
│ Package Manager │ apk │ apt │
│ Security Updates │ Fast, frequent │ Regular, well-tested │
│ DNS Resolver │ musl (simpler) │ glibc (full-featured) │
│ Locale Support │ Limited │ Full │
│ iconv │ GNU libiconv needed │ Works out of the box │
│ Compatibility │ Most PHP apps OK │ All PHP apps │
│ Build Speed │ Faster (smaller dl) │ Slower (larger packages) │
│ Debug Tools │ Limited │ Comprehensive │
│ gRPC / Protobuf │ May need workarounds │ Works natively │
│ Image Scanning │ Fewer CVEs reported │ More CVEs (more packages) │
└────────────────────┴────────────────────────┴───────────────────────────────┘
Image Selection Decision Tree
Start
│
├── Need Apache built-in?
│ └── YES ──▶ php:8.4-apache
│
├── Need PHP-FPM (web)?
│ ├── Need full glibc compatibility?
│ │ ├── YES ──▶ php:8.4-fpm (Debian)
│ │ └── NO ──▶ php:8.4-fpm-alpine
│ │
│ ├── Using gRPC/protobuf?
│ │ └── YES ──▶ php:8.4-fpm (Debian)
│ │
│ ├── Need locale/intl precision?
│ │ └── YES ──▶ php:8.4-fpm (Debian)
│ │
│ └── Default ──▶ php:8.4-fpm-alpine
│
├── CLI workers / cron / queue consumers?
│ └── php:8.4-cli-alpine (or cli for glibc)
│
└── Need parallel extension (ZTS)?
└── php:8.4-zts-alpine (or zts for glibc)
Version Pinning Strategies
| Strategy | Example | Stability | Updates |
|---|---|---|---|
| Full pin | php:8.4.2-fpm-alpine3.20 |
Highest | Manual only |
| Minor pin | php:8.4-fpm-alpine |
High | Patch auto |
| Major pin | php:8-fpm-alpine |
Medium | Minor auto |
| Latest | php:latest |
Lowest | All auto |
Recommended for production: Full pin or minor pin with CI rebuild schedule.
# Full pin (most reproducible)
FROM php:8.4.2-fpm-alpine3.20
# Minor pin (recommended balance)
FROM php:8.4-fpm-alpine
# AVOID in production
FROM php:latest
FROM php:fpm
Common Alpine Issues and Solutions
DNS Resolution
musl DNS resolver behaves differently from glibc. May cause issues with service discovery.
# Fix: Add DNS options
RUN echo "options ndots:0" >> /etc/resolv.conf
iconv Issues
Alpine uses musl iconv which has limited charset support.
# Fix: Install GNU libiconv
RUN apk add --no-cache gnu-libiconv
ENV LD_PRELOAD=/usr/lib/preloadable_libiconv.so
Locale Support
Alpine has minimal locale support by default.
# Fix: Install locale data for intl
RUN apk add --no-cache icu-data-full
Missing Shared Libraries
Some PECL extensions expect glibc-specific libraries.
# Fix: Install compatibility layer (use sparingly)
RUN apk add --no-cache gcompat
Image Lifecycle Best Practices
| Practice | Description |
|---|---|
| Pin digest in CI | Use php:8.4-fpm-alpine@sha256:abc... for fully reproducible builds |
| Rebuild weekly | Scheduled CI rebuild picks up security patches |
| Scan images | Use trivy image app:latest or docker scout |
| Track upstream | Monitor docker-library/php for breaking changes |
| Test Alpine compat | Run full test suite against Alpine image before adopting |
References
For detailed image variant comparison, see references/image-comparison.md.
For extension installation on different bases, see docker-php-extensions-knowledge.
Current listing version
0.0.1
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供 PHP Docker 基础镜像选择指南,解决开发者高频刚需场景的实际痛点
- 包含详细的 Alpine 与 Debian 对比,帮助用户做出明智的技术选型
- 涵盖版本固定策略、常见问题解决方案和最佳实践,内容全面且实用
Highlights
- description 明确描述了 Skill 的核心功能,触发词精准完整
- 覆盖多种变体,边界清晰,用户能准确理解 Skill 的用途
Highlights
- 文档结构清晰,包含多个逻辑分明的章节
- 使用表格、代码块、决策树等多种形式增强可读性
- frontmatter 完整,符合规范要求
Highlights
- 信息准确可靠,基于官方 PHP 镜像文档
- 提供了常见 Alpine 问题的具体解决方案
- 包含最佳实践建议,帮助用户规避潜在风险
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.