-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add description for docker-php-ext-install
#130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,28 @@ same commands to build and run: | |
Where `src/` is the directory containing all your php code and `config/` | ||
contains your `php.ini` file. | ||
|
||
### How to install more PHP extensions | ||
|
||
We provide a convenient script named `docker-php-ext-install`, you can use it to | ||
easily install PHP extension. | ||
|
||
For example, if you want to have a PHP-FPM image with `gd` and `mcrypt` | ||
extensions, you can inheriting the base image that you like, and write your own | ||
Dockerfile like this: | ||
|
||
FROM php:5.5.19-fpm | ||
# Install modules | ||
RUN apt-get update && apt-get install -y \ | ||
apt-utils re2c \ | ||
zlib1g zlib1g-dbg zlib1g-dev zlibc \ | ||
libpng12-0 libpng12-dev libpng3 \ | ||
libjpeg9 libjpeg9-dbg libjpeg9-dev \ | ||
libmcrypt-dev libmcrypt4 mcrypt \ | ||
&& docker-php-ext-install gd mcrypt | ||
CMD ["php-fpm"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will be inherited from the base image, won't it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The following simple example works well for me (to get both FROM php:5.6-fpm
RUN apt-get update && apt-get install -y \
libpng12-dev \
libmcrypt-dev \
&& docker-php-ext-install gd mcrypt There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The example is using php 5.5, which is probably more common than @tianon's example with 5.6 (since it is still quite new). We should minimally change to Also, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated. I keep getting errors like |
||
|
||
Remember, you must install dependencies for your extensions manually. | ||
|
||
### Without a `Dockerfile` | ||
|
||
If you don't want to include a `Dockerfile` in your project, it is sufficient to | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also,
Dockerfile
should be in backticks too. 👍