Merge pull request #420 from mlocati/keep-system-packages-cache

Let users keep the system packages cache
pull/421/head 1.2.56
Michele Locati 2021-08-13 17:21:25 +02:00 committed by GitHub
commit 71d7134de0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 19 deletions

View File

@ -41,7 +41,7 @@ RUN install-php-extensions gd xdebug
#### *Beware*
*When building locally, be sure you have the latest version of the `mlocati/php-extension-installer` image by running :*
*When building locally, be sure you have the latest version of the `mlocati/php-extension-installer` image by running:*
```sh
docker pull mlocati/php-extension-installer
@ -59,7 +59,7 @@ For example:
install-php-extensions xdebug-2.9.7
```
The script also support resolving *compatible* versions by prefixing the version with a caret (`^`).
The script also supports resolving *compatible* versions by prefixing the version with a caret (`^`).
For example:
```sh
@ -69,7 +69,7 @@ install-php-extensions xdebug-^2
install-php-extensions xdebug-^2.8
```
Pre-release versions extensions available on `PECL` can be setup by suffixing the extension's name with its state i.e `alpha`, `beta`, `rc`, `preview`, `devel` or `snapshot`.
Pre-release versions extensions available on `PECL` can be setup by suffixing the extension's name with its state i.e. `alpha`, `beta`, `rc`, `preview`, `devel` or `snapshot`.
For example:
```sh
@ -273,12 +273,13 @@ zlib
## Configuration
The compilation of some extensions may be fine-tuned to better fit your needs by using environment variables:
You can configure the behavior of the script, as well as fine-tune some extensions in order fit your needs, by using environment variables:
| Extension | Environment variable | Description |
|---|---|---|
| lzf | IPE_LZF_BETTERCOMPRESSION=1 | By default `install-php-extensions` compiles the `lzf` extension to prefer speed over size; you can use this environment variable to compile it preferring size over speed |
| event | IPE_EVENT_NAMESPACE=... | By default the `event` classes are defined in the root namespace. You can use this environment variable to specify a custom namespace |
| | `IPE_KEEP_SYSPKG_CACHE=1` | By default the script will clear the apt/apk/pear cache in order to save disk space. You can disable it by setting this environment variable |
| lzf | `IPE_LZF_BETTERCOMPRESSION=1` | By default `install-php-extensions` compiles the `lzf` extension to prefer speed over size; you can use this environment variable to compile it preferring size over speed |
| event | `IPE_EVENT_NAMESPACE=`... | By default the `event` classes are defined in the root namespace. You can use this environment variable to specify a custom namespace |
## Special requirements
@ -335,7 +336,7 @@ The error will be something like this:
good line of code #6
```
So, you should fix highlighed line (the one(s) at `line number`) by replacing what you see after the `-` with what you see after the `+`
So, you should fix highlighted line (the one(s) at `line number`) by replacing what you see after the `-` with what you see after the `+`
### Adding support to a new PHP extension?
@ -392,7 +393,7 @@ See [this pull request](https://github.com/mlocati/docker-php-extension-installe
PHP extensions published on the PECL archive contain a `package.xml` (or `package2.xml`) file describing the supported PHP versions and the options that can be used to compile it.
When we add support for a new PHP extension, and when a new version of a PHP extension is released, we have to check those constraints.
It's a rather tedious taks, so I developed a project that lets you easily check those constraints: you can find it at https://mlocati.github.io/pecl-info ([here](https://github.com/mlocati/pecl-info) you can find its source code).
It's a rather tedious task, so I developed a project that lets you easily check those constraints: you can find it at https://mlocati.github.io/pecl-info ([here](https://github.com/mlocati/pecl-info) you can find its source code).
## For the maintainers

View File

@ -2725,20 +2725,25 @@ cleanup() {
;;
esac
fi
case "$DISTRO" in
alpine)
rm -rf /var/cache/apk/*
;;
debian)
rm -rf /var/lib/apt/lists/*
;;
esac
docker-php-source delete
rm -rf /tmp/pear
rm -rf /tmp/src
rm -rf /tmp/pickle
rm -rf /tmp/pickle.tmp
rm -rf "$CONFIGURE_FILE"
case "${IPE_KEEP_SYSPKG_CACHE:-}" in
1 | y* | Y*) ;;
*)
case "$DISTRO" in
alpine)
rm -rf /var/cache/apk/*
;;
debian)
rm -rf /var/lib/apt/lists/*
;;
esac
rm -rf /tmp/pear
;;
esac
}
resetIFS

View File

@ -11,7 +11,7 @@ echo '# Linting shell scripts'
if ! docker --version >/dev/null 2>/dev/null; then
echo 'Docker is not installed, or it is not running.' >&2
rc=1
elif ! docker run --rm -v "$SRC_DIR:/src" -w /src --entrypoint /src/scripts/invoke-shfmt mvdan/shfmt:v3.3.1 fix; then
elif ! docker run --rm -v "$SRC_DIR:/src" -w /src --entrypoint /src/scripts/invoke-shfmt mvdan/shfmt:v3.3.1-alpine fix; then
echo 'ERROR!' >&2
rc=1
fi

View File

@ -16,7 +16,7 @@ if errorlevel 1 (
echo Docker is not installed, or it's not running >&2
set rc=1
) else (
docker run --rm -v "%SRC_DIR%:/src" -w /src --entrypoint /src/scripts/invoke-shfmt mvdan/shfmt:v3.3.1 fix
docker run --rm -v "%SRC_DIR%:/src" -w /src --entrypoint /src/scripts/invoke-shfmt mvdan/shfmt:v3.3.1-alpine fix
if errorlevel 1 (
echo ERROR! >&2
set rc=1