[转]Docker php extensions gd
本文转自:https://docs.docker.com/samples/library/php/
How to use this image
Create a Dockerfile in your PHP project
FROM php:7.2-cli
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
CMD [ "php", "./your-script.php" ]
Then, run the commands to build and run the Docker image:
$ docker build -t my-php-app .
$ docker run -it --rm --name my-running-app my-php-app
How to install more PHP extensions
Many extensions are already compiled into the image, so it’s worth checking the output of php -m or php -i before going through the effort of compiling more.
We provide the helper scripts docker-php-ext-configure, docker-php-ext-install, and docker-php-ext-enable to more easily install PHP extensions.
In order to keep the images smaller, PHP’s source is kept in a compressed tar file. To facilitate linking of PHP’s source with any extension, we also provide the helper script docker-php-source to easily extract the tar or delete the extracted source. Note: if you do use docker-php-source to extract the source, be sure to delete it in the same layer of the docker image.
FROM php:7.2-cli
RUN docker-php-source extract \
# do important things \
&& docker-php-source delete
PHP Core Extensions
For example, if you want to have a PHP-FPM image with iconv and gd extensions, you can inherit the base image that you like, and write your own Dockerfile like this:
FROM php:7.2-fpm
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
&& docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
Remember, you must install dependencies for your extensions manually. If an extension needs custom configure arguments, you can use the docker-php-ext-configure script like this example. There is no need to run docker-php-source manually in this case, since that is handled by the configure and install scripts.
See “Dockerizing Compiled Software” for a description of the technique Tianon uses for determining the necessary build-time dependencies for any bit of software (which applies directly to compiling PHP extensions).
[转]Docker php extensions gd的更多相关文章
- Docker运行sonarqube-(代码质量检测平台)
sonarqube是什么 SonarQube是用于持续检查代码质量的开源平台. 可用于持续集成,持续部署流程中的代码检测环节. idea和jenkins都提供了插件配合使用. liunx推荐配置环境 ...
- Helpers\RainCaptcha
Helpers\RainCaptcha This class can validate CAPTCHA images with RainCaptcha. It can generate an URL ...
- 安装Zabbix5.0
目录 概述 支持的平台 安全相关 支持TimescaleDB agent升级 垂直菜单 部署 安装要求 数据库要求 前端要求 服务端要求 Agent 2 Java gateway 安装 配置镜像源 安 ...
- Jenkins+Sonar 项目构建前代码审查
一.sonar简介 1.概述 Sonar (SonarQube)是一个开源平台,用于持续检查代码质量,不只是一个质量数据报告工具,更是代码质量管理平台. 支持Java, C#, C/C++, PL/S ...
- 部署Zabbix 6.0 LTS
Blog:博客园 个人 本部署文档适用于CentOS 8.X/RHEL 8.X/Anolis OS 8.X/AlmaLinux 8.X. Zabbix 6.0 LTS于2022年2月15日发布,本次大 ...
- 给docker里的php安装gd扩展
docker官方镜像为安装php扩展封装了函数,为开发者提供了很大的便利,以下以Dockerfile的形式演示安装gd扩展的方法,安装gd扩展需要安装几个依赖包,安装依赖包使用系统命令,安装命令根据基 ...
- docker安装GD扩展
apt update #更新软件源 apt install -y libwebp-dev libjpeg-dev libpng-dev libfreetype6-dev #安装各种库 docker-p ...
- Docker为PHP安装gd扩展
安装扩展库的通常命令 docker-php-ext-install 扩展库名 安装gd库需要特殊照顾,步骤如下 //进入PHP容器 //更新软件源 apt update //安装各种库 apt ins ...
- Docker的镜像
镜像是容器的运行基础,容器是镜像运行后台的形态 镜像的概念 镜像是一个包含程序运行必要依赖环境和代码的只读文件,它采用分层的文件系统,将每一次改变以读写层的形式增加到原来的只读文件上 镜像的系统结构 ...
随机推荐
- bzoj4445(半平面交)
列出式子对一下然后上半平面交 #include<iostream> #include<cstring> #include<cmath> #include<cs ...
- Java 8 特性
1.简介 毫无疑问,Java 8是自Java 5(2004年)发布以来Java语言最大的一次版本升级,Java 8带来了很多的新特性,比如编译器.类库.开发工具和JVM(Java虚拟机).在这篇教程 ...
- MySQL 游标(PREPARE预处理语句)
概述 本章节介绍使用游标来批量进行表操作,包括批量添加索引.批量添加字段等.如果对存储过程.变量定义.预处理还不是很熟悉先阅读我前面写过的关于这三个概念的文章,只有先了解了这三个概念才能更好的理解这篇 ...
- 怎么随时获取Spring的上下文ApplicaitonContext,和Spring管理的Bean
BeanFactory接口 Interface BeanFactory getBean <T> T getBean(String name, Class<T> required ...
- 一位90后的自述:如何从年薪3w到30w
作者介绍:90后生人/男/二本本科/世界500强技术主管 1.引言 上海小胖,曾就职于pwc(普华永道)担任TechLeader,带领DS(Data Scientist)团队完成全美医疗保险大数据项目 ...
- Jenkins系列之七——前端app自动打包
了两周终于搞掂了,期间各种搜教程.各种懵逼,各种坑对小白来还是很难的额.废话不多说直接开撸~~~ 一.介绍下什么是Gradle Gradle是一个基于JVM的构建工具,是一款通用灵活的构建工具,支持m ...
- Centos7静默安装Weblogic12C
1.前言 WebLogic是美国Oracle公司出品的一个application server,确切的说是一个基于JAVAEE架构的中间件,WebLogic是用于开发.集成.部署和管理大型分布式W ...
- 如何在mpvue下收集小程序的formId
什么是formId formId是小程序可以向用户发送模板消息的通行证,简单而言,你只有获取到formId,把它交给后台,后台同学才能向用户发送通知消息,而这个通行证的有效期只有七天.这是微信为了防止 ...
- Android--Service之基础
前言 本篇博客聊一下Android下的Service组件,对于Service组件,有点类似于Windows下的服务.Service是Android四大组件中与Activity最相似的组件,它们的区别在 ...
- 详解网络编程必会的poll和epoll函数
前言 之前已经介绍过select函数,请参考这篇博客:https://www.cnblogs.com/liudw-0215/p/9661583.html,原理都是类似的,有时间先阅读下那篇博客,以便于 ...