mirror of
https://github.com/devilbox/docker-php-fpm.git
synced 2025-12-14 13:01:15 +00:00
Fix build for php:7-2-work
This commit is contained in:
@@ -56,7 +56,7 @@ RUN set -x \
|
||||
nano \
|
||||
net-tools \
|
||||
netcat \
|
||||
postgresql-client \
|
||||
# postgresql-client \
|
||||
python-pip \
|
||||
rubygems \
|
||||
ruby-dev \
|
||||
|
||||
@@ -56,7 +56,7 @@ RUN set -x \
|
||||
nano \
|
||||
net-tools \
|
||||
netcat \
|
||||
postgresql-client \
|
||||
# postgresql-client \
|
||||
python-pip \
|
||||
rubygems \
|
||||
ruby-dev \
|
||||
|
||||
@@ -56,7 +56,7 @@ RUN set -x \
|
||||
nano \
|
||||
net-tools \
|
||||
netcat \
|
||||
postgresql-client \
|
||||
# postgresql-client \
|
||||
python-pip \
|
||||
rubygems \
|
||||
ruby-dev \
|
||||
|
||||
@@ -56,7 +56,7 @@ RUN set -x \
|
||||
nano \
|
||||
net-tools \
|
||||
netcat \
|
||||
postgresql-client \
|
||||
# postgresql-client \
|
||||
python-pip \
|
||||
rubygems \
|
||||
ruby-dev \
|
||||
|
||||
@@ -56,7 +56,7 @@ RUN set -x \
|
||||
nano \
|
||||
net-tools \
|
||||
netcat \
|
||||
postgresql-client \
|
||||
# postgresql-client \
|
||||
python-pip \
|
||||
rubygems \
|
||||
ruby-dev \
|
||||
|
||||
@@ -56,7 +56,7 @@ RUN set -x \
|
||||
nano \
|
||||
net-tools \
|
||||
netcat \
|
||||
postgresql-client \
|
||||
# postgresql-client \
|
||||
python-pip \
|
||||
rubygems \
|
||||
ruby-dev \
|
||||
|
||||
51
build/README.md
Normal file
51
build/README.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# Build helper
|
||||
|
||||
This directory contains all tools for building.
|
||||
|
||||
## `ansible/`
|
||||
|
||||
The `ansible/` directory contains a setup to generate all Dockerfiles. Once generated, they will be placed or updated into [../Dockerfiles](../Dockerfiles).
|
||||
|
||||
**How to generate via ansible command**
|
||||
```bash
|
||||
# From inside ansible directory
|
||||
cd ansible
|
||||
ansible-playbook generate.yml --diff
|
||||
```
|
||||
|
||||
**How to generate via Makefile**
|
||||
```bash
|
||||
# From inside root git directory
|
||||
cd ..
|
||||
make generate
|
||||
```
|
||||
|
||||
**Requirements**
|
||||
|
||||
In order to generate Dockerfiles, you will have to have ansible installed:
|
||||
```
|
||||
pip install ansible
|
||||
```
|
||||
|
||||
## `gen-readme.sh`
|
||||
|
||||
`gen-readme.sh` will update the README.md with currently enabled PHP modules for each Docker image.
|
||||
|
||||
**How to update the README.md**
|
||||
|
||||
```bash
|
||||
# Update for all Docker images
|
||||
./gen-readme.sh
|
||||
|
||||
# Update for specific Docker image
|
||||
./gen-readme.sh 5.4
|
||||
./gen-readme.sh 5.5
|
||||
./gen-readme.sh 5.6
|
||||
./gen-readme.sh 7.0
|
||||
./gen-readme.sh 7.1
|
||||
./gen-readme.sh 7.2
|
||||
```
|
||||
|
||||
**Requirements**
|
||||
|
||||
If you want to update the README.md for a specific Docker image, you must have built this image prior running `gen-readme.sh`.
|
||||
@@ -56,7 +56,7 @@ RUN set -x \
|
||||
nano \
|
||||
net-tools \
|
||||
netcat \
|
||||
postgresql-client \
|
||||
# postgresql-client \
|
||||
python-pip \
|
||||
rubygems \
|
||||
ruby-dev \
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Be very strict
|
||||
set -e
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
# Get absolute directory of this script
|
||||
CWD="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
|
||||
|
||||
|
||||
###
|
||||
### Show Usage
|
||||
###
|
||||
print_usage() {
|
||||
echo "Usage: gen-readme.sh"
|
||||
echo " gen-readme.sh 5.4"
|
||||
@@ -16,11 +22,17 @@ print_usage() {
|
||||
echo " gen-readme.sh 7.2"
|
||||
}
|
||||
|
||||
|
||||
###
|
||||
### Extract PHP modules in alphabetical order and comma separated in one line
|
||||
###
|
||||
get_modules() {
|
||||
tag="${1}"
|
||||
|
||||
# Retrieve all modules
|
||||
PHP_MODULES="$( docker run -it --entrypoint=php devilbox/php-fpm:${tag} -m )"
|
||||
|
||||
# Process module string into correct format for README.md
|
||||
PHP_MODULES="$( echo "${PHP_MODULES}" | sed 's/^\[.*//g' )" # Remove PHP Modules headlines
|
||||
PHP_MODULES="$( echo "${PHP_MODULES}" | sort -fu )" # Unique
|
||||
PHP_MODULES="$( echo "${PHP_MODULES}" | sed '/^\s*$/d' )" # Remove empty lines
|
||||
@@ -32,14 +44,23 @@ get_modules() {
|
||||
echo "${PHP_MODULES}"
|
||||
}
|
||||
|
||||
|
||||
###
|
||||
### Replace modules in Readme for specified PHP version
|
||||
###
|
||||
update_readme() {
|
||||
v="${1}"
|
||||
# Those sections must exist in README.md, otherwise this script will exit with errors
|
||||
sed -i'' "s|<td id=\"${v//.}-base\">.*<\/td>|<td id=\"${v//.}-base\">$( get_modules "${v}-base" )<\/td>|g" "${CWD}/../README.md"
|
||||
sed -i'' "s|<td id=\"${v//.}-mods\">.*<\/td>|<td id=\"${v//.}-mods\">$( get_modules "${v}-mods" )<\/td>|g" "${CWD}/../README.md"
|
||||
}
|
||||
|
||||
|
||||
###
|
||||
### Entrypoint
|
||||
###
|
||||
if [ "${#}" -eq "0" ]; then
|
||||
# Update PHP modules for all versions at once
|
||||
update_readme "5.4"
|
||||
update_readme "5.5"
|
||||
update_readme "5.6"
|
||||
@@ -47,6 +68,7 @@ if [ "${#}" -eq "0" ]; then
|
||||
update_readme "7.1"
|
||||
update_readme "7.2"
|
||||
elif [ "${#}" -gt "1" ]; then
|
||||
# Specifying more than 1 argument is wrong
|
||||
echo "Error, invalid number of arguments."
|
||||
print_usage
|
||||
exit 1
|
||||
@@ -57,10 +79,12 @@ else
|
||||
&& [ "${1}" != "7.0" ] \
|
||||
&& [ "${1}" != "7.1" ] \
|
||||
&& [ "${1}" != "7.2" ]; then
|
||||
# Argument does not match any of the PHP versions
|
||||
echo "Error, invalid argument."
|
||||
print_usage
|
||||
exit 1
|
||||
else
|
||||
# Update PHP modules for one specific PHP version
|
||||
update_readme "${1}"
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user