docker-php-extension-installer
4,996
Stars
0
Forks
0
Watchers
0
Open Issues
未知
许可证
Shell
语言
创建时间
最近更新
项目能做什么
轻松在 Docker 容器中安装 PHP 扩展的工具。
来源:AI 基于仓库事实生成
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
[](https://github.com/mlocati/docker-php-extension-installer/releases)
[](https://hub.docker.com/r/mlocati/php-extension-installer)
[](https://github.com/mlocati/docker-php-extension-installer/pkgs/container/php-extension-installer)
[](https://github.com/mlocati/docker-php-extension-installer/actions/workflows/check-updates.yml)
> [!NOTE]
> A new version of this project is being developed at [mlocati/install-php-extensions](https://github.com/mlocati/install-php-extensions).
> It's a rewrite in PHP that also works outside of the official PHP Docker images (for example, with the PHP installed by APT or APK).
> It's not ready for production yet, but feedback is very welcome!
# Easy installation of PHP extensions in official PHP Docker images
This repository contains a script that can be used to easily install a PHP extension inside the [official PHP Docker images](https://hub.docker.com/_/php/).
The script will install all the required APT/APK packages; at the end of the script execution, the no-more needed packages will be removed so that the image will be much smaller.
Supported docker images are:
- Debian-based docker images: since jessie (Debian 8) (minimum PHP version: 5.5)
- Alpine-based docker images: since Alpine 3.9 (minimum PHP version: 7.1)
See also the notes in the [Special requirements](#special-requirements) section.
## Usage
You have many ways to use this script within your `Dockerfile`s.
Here's a list of sample `Dockerfile`s that install the GD and xdebug PHP extensions:
### Downloading the script on the fly with `ADD`
```Dockerfile
FROM php:7.2-cli
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN install-php-extensions gd xdebug
```
### Downloading the script on the fly with `curl`
```Dockerfile
FROM php:7.2-cli
RUN curl -sSLf \
-o /usr/local/bin/install-php-extensions \
https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && \
chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions gd xdebug
```
### Direct execution with `curl`
```Dockerfile
FROM php:8.2-cli
RUN ( curl -sSLf https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions -o - || echo 'return 1' ) | sh -s \
gd xdebug
```
### Copying the script from a Docker image
- using GitHub Container Registry
阅读完整原文
商业机会分析 AI 生成
企业级预编译 PHP 精简镜像订阅服务
| 产品构想 | 基于该工具的自动化能力,为特定框架(如 Laravel、WordPress、Symfony)或行业场景构建并维护一系列开箱即用、体积最小化、定期打安全补丁的私有 Docker 基础镜像,提供给需要加速 CI/CD 构建和满足安全合规的团队。 |
| 核心功能 | 多版本 PHP 与常用扩展组合预编译、自动化的安全漏洞扫描与 CVE 修复推送、私有 Registry 同步、SBOM(软件物料清单)生成 |
| 目标用户 | 中小型互联网公司 DevOps 团队、外包开发团队、对镜像安全与构建速度敏感的企业 |
| 难度/周期 | 中等 · 1-2个月 · 成本:低(主要是 CI 构建算力与镜像托管存储费用,推测) |
| 收费模式 | 按团队/席位或按镜像拉取量订阅收费(SaaS/私有镜像源授权) |
| 竞争风险 | 官方或社区可能已有类似的免费基础镜像;用户对第三方维护镜像的信任度需要时间建立。 |
| 依据 | AI推测 |
内网/离线环境 PHP 扩展私有化构建套件
| 产品构想 | 针对无法访问公网(GitHub/PECL/APT/APK 源)的政企、金融等内网环境,打包提供离线版扩展安装器、本地依赖缓存仓库及标准化的 Dockerfile 模板。 |
| 核心功能 | 全量离线依赖包同步工具、内网私有源配置脚本、支持审计的构建日志输出、常见扩展兼容性测试报告 |
| 目标用户 | 金融、政企、传统大型企业内部 IT 与运维部门 |
| 难度/周期 | 中等偏高 · 2-3个月 · 成本:低(初期主要是脚本封装与多环境测试成本,推测) |
| 收费模式 | 按项目/企业一次性软件授权费 + 年度维护更新服务费 |
| 竞争风险 | 目标客户采购流程长,且需要适配多种奇特的内网安全策略与老旧系统版本。 |
| 依据 | 尚需验证的假设 |
PHP Docker 环境可视化配置与优化 SaaS
| 产品构想 | 提供一个 Web 界面或 IDE 插件,让开发者勾选 PHP 版本、所需扩展(支持版本范围如 ^2)及运行模式,自动生成最佳实践的 Dockerfile(集成该安装器),并提供镜像体积预估与 CI/CD 缓存优化建议。 |
| 核心功能 | 可视化扩展选择与依赖冲突提示、一键生成多阶段构建 Dockerfile、本地开发环境(Docker Compose)模板导出、团队配置共享与版本管理 |
| 目标用户 | 初级 PHP 开发者、全栈独立开发者、需要快速搭建标准化开发环境的团队 |
| 难度/周期 | 低 · 2-4周 · 成本:极低(静态站点或轻量级后端服务器即可) |
| 收费模式 | 基础功能免费引流,针对团队协作、私有模板库、CI/CD 集成诊断等高级功能收取订阅费,或通过赞助/广告变现 |
| 竞争风险 | 纯生成工具壁垒较低,容易被 AI 编程助手(如 Copilot/ChatGPT)替代,需强化团队协作或环境诊断等差异化功能。 |
| 依据 | AI推测 |
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
| 项目 | 中文简介 | Stars | 语言 |
|---|---|---|---|
| cirosantilli/china-dictatorship | 中文介绍暂未生成 反中共政治宣传库。Anti Chinese government propaganda. 住在中国真名用户的网友请别给星 |
3,334 | HTML |
| gege-circle/.github | 中文介绍暂未生成 这里是GitHub的草场,也是戈戈圈爱好者的交流地,主要讨论动漫、游戏、科技、人文、生活等所有话题,欢迎各位小伙伴们在此 |
2,093 | - |
| cirosantilli/china-dictatroship-7 | 中文介绍暂未生成 反中共政治宣传库。Anti Chinese government propaganda. https://github. |
389 | HTML |
| zszszszsz/.config | 中文介绍暂未生成 # # Automatically generated file; DO NOT EDIT. # OpenWrt Con |
369 | Shell |
| mRFWq7LwNPZjaVv5v6eo/cihna-dictattorshrip-8 | 中文介绍暂未生成 反中共政治宣传库。Anti Chinese government propaganda. https://github. |
216 | HTML |
| panbinibn/OpenPacketFix_ | 中文介绍暂未生成 大陆修宪香港恶法台湾武统朝鲜毁约美中冷战等都是王沪宁愚弄习思想极左命运共同体的大策划中共窃国这半个多世纪所犯下的滔天罪恶 |
214 | - |
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。
项目优势与风险
| 技术成熟度 | 创建于 ,最近推送 ,发布过 100 个 Release |
| 社区活跃 | Star 4,996 / Fork 0 / Issue 0(数据支持,可自行核实) |
| 许可证 | 未检测到(需人工确认) |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
快速开始(以仓库 README 为准)
git clone https://github.com/mlocati/docker-php-extension-installer.git cd docker-php-extension-installer # 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。