Skip to content

Commit f976a52

Browse files
committed
Update and clarify usage of extensions with slim and fat
1 parent a0a7682 commit f976a52

File tree

2 files changed

+34
-28
lines changed

2 files changed

+34
-28
lines changed

README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -163,25 +163,24 @@ RUN npm run build
163163

164164
This image comes with 2 "types": the *slim* and the **fat** image.
165165

166-
The slim image contains only a set a base PHP extensions.
166+
These extensions are enabled by default in slim image: `calendar` `ctype` `curl` `date` `dom` `exif` `fileinfo` `filter` `ftp` `gettext` `iconv` `json` `mbstring` `opcache` `openssl` `pcntl` `pcre` `PDO` `Phar` `posix` `readline` `shmop` `Reflection` `session` `shmop` `SimpleXML` `sockets` `sodium` `SPL` `sysvmsg` `sysvsem` `sysvshm` `tokenizer` `xml` `xmlreader` `xmlwriter` `xsl` `zip`
167167

168-
Only these extensions are available in the slim image: `calendar` `ctype` `curl` `dom` `exif` `fileinfo` `ftp` `gettext` `iconv` `json` `mbstring` `opcache` `pcntl` `pdo` `phar` `posix` `readline` `shmop` `simplexml` `sockets` `sysvmsg` `sysvsem` `sysvshm` `tokenizer` `wddx` `xml` `xmlreader` `xmlwriter` `xsl` `zip`
168+
This list can be outdated, you can verify by executing : `docker run --rm -it thecodingmachine/php:8.0-v4-slim-cli php -m`
169169

170-
These extensions are enabled by default.
170+
The slim image provides a simple way to install the other extensions. You would typically use the "slim" image in a `Dockerfile` when building your own custom image.
171171

172-
The slim image provides a simple way to install the other extensions. You would typically use the "slim"
173-
image in a `Dockerfile` when building your own custom image.
174-
175-
The fat image contains the most commonly used extensions. You would typically use it in a local or CI environment.
172+
The fat image contains the most commonly used extensions. You would typically use it in a local or CI environment.
176173

177174
### Fat image
178175

179176
Below is a list of extensions available in this image:
180177

181-
**Enabled by default (in addition to extensions enabled in Slim image):** apcu mysqli pdo_mysql igbinary redis soap
178+
**Enabled by default (in addition to extensions enabled in Slim image):** `apcu`, `hash`, `iconv`, `igbinary`, `mysqli`, `mysqlnd`, `redis`, `soap`, `xsl`, `zlib` and all enabled in slim.
182179

183180
**Available (can be enabled using environment variables):** `amqp` `ast` `bcmath` `blackfire` `bz2` `dba` `ds` `enchant` `ev` `event` `exif` `mailparse` `msgpack` `gd` `gettext` `gmp` `gnupg` `grpc` `igbinary` `imagick` `imap` `intl` `ldap` `mcrypt` `memcached` `mongodb` `pcov` `pdo_dblib` `pdo_pgsql` `pdo_sqlite` `pgsql` `pspell` `shmop` `snmp` `sockets` `sqlite3` `swoole` `tidy` `uploadprogress` `uuid` `weakref(-beta)` `xdebug` `xmlrpc` `xsl` `yaml`
184181

182+
This list can be outdated, you can verify by executing : `docker run --rm -it thecodingmachine/php:8.0-v4-cli php -m`
183+
185184
**Note**:
186185

187186
- *mcrypt* is not available anymore in PHP 7.3+
@@ -225,9 +224,11 @@ FROM thecodingmachine/php:8.0-v4-slim-apache
225224
# of the extensions (thanks to a ONBUILD hook in the slim image)
226225
```
227226

228-
Beware! The `ARG PHP_EXTENSIONS` command must be written before the `FROM`. This is not a typo.
229-
230-
**Heads up**: if you are using multistage builds, the "ARG" variable must be put at the very top of the file (before the
227+
Beware :
228+
* The `ARG PHP_EXTENSIONS` command must be written before the `FROM`. This is not a typo.
229+
* `ARG PHP_EXTENSIONS=""` it's not the same as `ENV PHP_EXTENSIONS=""`
230+
* You can't use `ARG PHP_EXTENSION_MYEXT=""` like the fat image.
231+
* **Heads up**: if you are using multistage builds, the "ARG" variable must be put at the very top of the file (before the
231232
first FROM):
232233

233234
```Dockerfile
@@ -346,9 +347,11 @@ As an alternative, you can use the `APACHE_EXTENSIONS` global variable:
346347
APACHE_EXTENSIONS="dav ssl"
347348
```
348349

349-
**Apache modules enabled by default:** `access_compat` `alias` `auth_basic` `authn_core` `authn_file` `authz_core` `authz_host` `authz_user` `autoindex` `deflate` `dir` `env` `expires` `filter` `mime` `mpm_prefork` `negotiation` `php7` `reqtimeout` `rewrite` `setenvif` `status`
350+
**Apache modules enabled by default:** `access_compat` `alias` `auth_basic` `authn_core` `authn_file` `authz_core` `authz_host` `authz_user` `autoindex` `deflate` `dir` `env` `expires` `filter` `mime` `mpm_prefork` `negotiation` `php8.0 (depend of your active version)` `reqtimeout` `rewrite` `setenvif` `status`
351+
352+
**Apache modules available:** `access_compat` `actions` `alias` `allowmethods` `asis` `auth_basic` `auth_digest` `auth_form` `authn_anon` `authn_core` `authn_dbd` `authn_dbm` `authn_file` `authn_socache` `authnz_fcgi` `authnz_ldap` `authz_core` `authz_dbd` `authz_dbm` `authz_groupfile` `authz_host` `authz_owner` `authz_user` `autoindex` `brotli` `buffer` `cache` `cache_disk` `cache_socache` `cern_meta` `cgi` `cgid` `charset_lite` `data` `dav` `dav_fs` `dav_lock` `dbd` `deflate` `dialup` `dir` `dump_io` `echo` `env` `ext_filter` `expires` `file_cache` `filter` `headers` `heartbeat` `heartmonitor` `http2` `ident` `imagemap` `include` `info` `lbmethod_bybusyness` `lbmethod_byrequests` `lbmethod_bytraffic` `lbmethod_heartbeat` `ldap` `log_debug` `log_forensic` `lua` `macro` `md` `mime` `mime_magic` `mpm_event` `mpm_prefork` `mpm_worker` `negotiation` `php8.0 (depend of your active version)` `proxy` `proxy_ajp` `proxy_balancer` `proxy_connect` `proxy_express` `proxy_fcgi` `proxy_fdpass` `proxy_ftp` `proxy_hcheck` `proxy_html` `proxy_http` `proxy_http2` `proxy_scgi` `proxy_wstunnel` `ratelimit` `reflector` `remoteip` `reqtimeout` `request` `rewrite` `sed` `session` `session_cookie` `session_crypto` `session_dbd` `setenvif` `slotmem_plain` `slotmem_shm` `socache_dbm` `socache_memcache` `socache_redis` `socache_shmcb` `speling` `ssl` `status` `substitute` `suexec` `unique_id` `userdir` `usertrack` `vhost_alias` `xml2enc`
350353

351-
**Apache modules available:** `access_compat` `actions` `alias` `allowmethods` `asis` `auth_basic` `auth_digest` `auth_form` `authn_anon` `authn_core` `authn_dbd` `authn_dbm` `authn_file` `authn_socache` `authnz_fcgi` `authnz_ldap` `authz_core` `authz_dbd` `authz_dbm` `authz_groupfile` `authz_host` `authz_owner` `authz_user` `autoindex` `buffer` `cache` `cache_disk` `cache_socache` `cgi` `cgid` `charset_lite` `data` `dav` `dav_fs` `dav_lock` `dbd` `deflate` `dialup` `dir` `dump_io` `echo` `env` `ext_filter` `expires` `file_cache` `filter` `headers` `heartbeat` `heartmonitor` `ident` `include` `info` `lbmethod_bybusyness` `lbmethod_byrequests` `lbmethod_bytraffic` `lbmethod_heartbeat` `ldap` `log_debug` `log_forensic` `lua` `macro` `mime` `mime_magic` `mpm_event` `mpm_prefork` `mpm_worker` `negotiation` `php7` `proxy` `proxy_ajp` `proxy_balancer` `proxy_connect` `proxy_express` `proxy_fcgi` `proxy_fdpass` `proxy_ftp` `proxy_html` `proxy_http` `proxy_scgi` `proxy_wstunnel` `ratelimit` `reflector` `remoteip` `reqtimeout` `request` `rewrite` `sed` `session` `session_cookie` `session_crypto` `session_dbd` `setenvif` `slotmem_plain` `slotmem_shm` `socache_dbm` `socache_memcache` `socache_shmcb` `speling` `ssl` `status` `substitute` `suexec` `unique_id` `userdir` `usertrack` `vhost_alias` `xml2enc`
354+
This list can be outdated, you can verify by executing : `docker run --rm -it thecodingmachine/php:8.0-v4-slim-apache a2enmod`
352355

353356

354357
## Debugging
@@ -538,7 +541,7 @@ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/sr
538541

539542
## Using the CLI variant
540543

541-
The CLI images (thecodingmachine/php:7.x-v4-cli) expect a command to be passed in parameter.
544+
The CLI images (thecodingmachine/php:8.0-v4-cli) expect a command to be passed in parameter.
542545
You should override the Docker "command".
543546

544547
Important! You should not override the Docker "entrypoint".

utils/README.blueprint.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,24 @@ RUN npm run build
8181

8282
This image comes with 2 "types": the *slim* and the **fat** image.
8383

84-
The slim image contains only a set a base PHP extensions.
84+
These extensions are enabled by default in slim image: `calendar` `ctype` `curl` `date` `dom` `exif` `fileinfo` `filter` `ftp` `gettext` `iconv` `json` `mbstring` `opcache` `openssl` `pcntl` `pcre` `PDO` `Phar` `posix` `readline` `shmop` `Reflection` `session` `shmop` `SimpleXML` `sockets` `sodium` `SPL` `sysvmsg` `sysvsem` `sysvshm` `tokenizer` `xml` `xmlreader` `xmlwriter` `xsl` `zip`
8585

86-
Only these extensions are available in the slim image: `calendar` `ctype` `curl` `dom` `exif` `fileinfo` `ftp` `gettext` `iconv` `json` `mbstring` `opcache` `pcntl` `pdo` `phar` `posix` `readline` `shmop` `simplexml` `sockets` `sysvmsg` `sysvsem` `sysvshm` `tokenizer` `wddx` `xml` `xmlreader` `xmlwriter` `xsl` `zip`
86+
This list can be outdated, you can verify by executing : `docker run --rm -it thecodingmachine/php:{{ $image.php_version }}-v4-slim-cli php -m`
8787

88-
These extensions are enabled by default.
88+
The slim image provides a simple way to install the other extensions. You would typically use the "slim" image in a `Dockerfile` when building your own custom image.
8989

90-
The slim image provides a simple way to install the other extensions. You would typically use the "slim"
91-
image in a `Dockerfile` when building your own custom image.
92-
93-
The fat image contains the most commonly used extensions. You would typically use it in a local or CI environment.
90+
The fat image contains the most commonly used extensions. You would typically use it in a local or CI environment.
9491

9592
### Fat image
9693

9794
Below is a list of extensions available in this image:
9895

99-
**Enabled by default (in addition to extensions enabled in Slim image):** apcu mysqli pdo_mysql igbinary redis soap
96+
**Enabled by default (in addition to extensions enabled in Slim image):** `apcu`, `hash`, `iconv`, `igbinary`, `mysqli`, `mysqlnd`, `redis`, `soap`, `xsl`, `zlib` and all enabled in slim.
10097

10198
**Available (can be enabled using environment variables):** `amqp` `ast` `bcmath` `blackfire` `bz2` `dba` `ds` `enchant` `ev` `event` `exif` `mailparse` `msgpack` `gd` `gettext` `gmp` `gnupg` `grpc` `igbinary` `imagick` `imap` `intl` `ldap` `mcrypt` `memcached` `mongodb` `pcov` `pdo_dblib` `pdo_pgsql` `pdo_sqlite` `pgsql` `pspell` `shmop` `snmp` `sockets` `sqlite3` `swoole` `tidy` `uploadprogress` `uuid` `weakref(-beta)` `xdebug` `xmlrpc` `xsl` `yaml`
10299

100+
This list can be outdated, you can verify by executing : `docker run --rm -it thecodingmachine/php:{{ $image.php_version }}-v4-cli php -m`
101+
103102
**Note**:
104103

105104
- *mcrypt* is not available anymore in PHP 7.3+
@@ -143,9 +142,11 @@ FROM thecodingmachine/php:{{ $image.php_version }}-v4-slim-apache
143142
# of the extensions (thanks to a ONBUILD hook in the slim image)
144143
```
145144

146-
Beware! The `ARG PHP_EXTENSIONS` command must be written before the `FROM`. This is not a typo.
147-
148-
**Heads up**: if you are using multistage builds, the "ARG" variable must be put at the very top of the file (before the
145+
Beware :
146+
* The `ARG PHP_EXTENSIONS` command must be written before the `FROM`. This is not a typo.
147+
* `ARG PHP_EXTENSIONS=""` it's not the same as `ENV PHP_EXTENSIONS=""`
148+
* You can't use `ARG PHP_EXTENSION_MYEXT=""` like the fat image.
149+
* **Heads up**: if you are using multistage builds, the "ARG" variable must be put at the very top of the file (before the
149150
first FROM):
150151

151152
```Dockerfile
@@ -264,9 +265,11 @@ As an alternative, you can use the `APACHE_EXTENSIONS` global variable:
264265
APACHE_EXTENSIONS="dav ssl"
265266
```
266267

267-
**Apache modules enabled by default:** `access_compat` `alias` `auth_basic` `authn_core` `authn_file` `authz_core` `authz_host` `authz_user` `autoindex` `deflate` `dir` `env` `expires` `filter` `mime` `mpm_prefork` `negotiation` `php7` `reqtimeout` `rewrite` `setenvif` `status`
268+
**Apache modules enabled by default:** `access_compat` `alias` `auth_basic` `authn_core` `authn_file` `authz_core` `authz_host` `authz_user` `autoindex` `deflate` `dir` `env` `expires` `filter` `mime` `mpm_prefork` `negotiation` `php8.0 (depend of your active version)` `reqtimeout` `rewrite` `setenvif` `status`
269+
270+
**Apache modules available:** `access_compat` `actions` `alias` `allowmethods` `asis` `auth_basic` `auth_digest` `auth_form` `authn_anon` `authn_core` `authn_dbd` `authn_dbm` `authn_file` `authn_socache` `authnz_fcgi` `authnz_ldap` `authz_core` `authz_dbd` `authz_dbm` `authz_groupfile` `authz_host` `authz_owner` `authz_user` `autoindex` `brotli` `buffer` `cache` `cache_disk` `cache_socache` `cern_meta` `cgi` `cgid` `charset_lite` `data` `dav` `dav_fs` `dav_lock` `dbd` `deflate` `dialup` `dir` `dump_io` `echo` `env` `ext_filter` `expires` `file_cache` `filter` `headers` `heartbeat` `heartmonitor` `http2` `ident` `imagemap` `include` `info` `lbmethod_bybusyness` `lbmethod_byrequests` `lbmethod_bytraffic` `lbmethod_heartbeat` `ldap` `log_debug` `log_forensic` `lua` `macro` `md` `mime` `mime_magic` `mpm_event` `mpm_prefork` `mpm_worker` `negotiation` `php8.0 (depend of your active version)` `proxy` `proxy_ajp` `proxy_balancer` `proxy_connect` `proxy_express` `proxy_fcgi` `proxy_fdpass` `proxy_ftp` `proxy_hcheck` `proxy_html` `proxy_http` `proxy_http2` `proxy_scgi` `proxy_wstunnel` `ratelimit` `reflector` `remoteip` `reqtimeout` `request` `rewrite` `sed` `session` `session_cookie` `session_crypto` `session_dbd` `setenvif` `slotmem_plain` `slotmem_shm` `socache_dbm` `socache_memcache` `socache_redis` `socache_shmcb` `speling` `ssl` `status` `substitute` `suexec` `unique_id` `userdir` `usertrack` `vhost_alias` `xml2enc`
268271

269-
**Apache modules available:** `access_compat` `actions` `alias` `allowmethods` `asis` `auth_basic` `auth_digest` `auth_form` `authn_anon` `authn_core` `authn_dbd` `authn_dbm` `authn_file` `authn_socache` `authnz_fcgi` `authnz_ldap` `authz_core` `authz_dbd` `authz_dbm` `authz_groupfile` `authz_host` `authz_owner` `authz_user` `autoindex` `buffer` `cache` `cache_disk` `cache_socache` `cgi` `cgid` `charset_lite` `data` `dav` `dav_fs` `dav_lock` `dbd` `deflate` `dialup` `dir` `dump_io` `echo` `env` `ext_filter` `expires` `file_cache` `filter` `headers` `heartbeat` `heartmonitor` `ident` `include` `info` `lbmethod_bybusyness` `lbmethod_byrequests` `lbmethod_bytraffic` `lbmethod_heartbeat` `ldap` `log_debug` `log_forensic` `lua` `macro` `mime` `mime_magic` `mpm_event` `mpm_prefork` `mpm_worker` `negotiation` `php7` `proxy` `proxy_ajp` `proxy_balancer` `proxy_connect` `proxy_express` `proxy_fcgi` `proxy_fdpass` `proxy_ftp` `proxy_html` `proxy_http` `proxy_scgi` `proxy_wstunnel` `ratelimit` `reflector` `remoteip` `reqtimeout` `request` `rewrite` `sed` `session` `session_cookie` `session_crypto` `session_dbd` `setenvif` `slotmem_plain` `slotmem_shm` `socache_dbm` `socache_memcache` `socache_shmcb` `speling` `ssl` `status` `substitute` `suexec` `unique_id` `userdir` `usertrack` `vhost_alias` `xml2enc`
272+
This list can be outdated, you can verify by executing : `docker run --rm -it thecodingmachine/php:{{ $image.php_version }}-v4-slim-apache a2enmod`
270273

271274

272275
## Debugging
@@ -456,7 +459,7 @@ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/sr
456459

457460
## Using the CLI variant
458461

459-
The CLI images (thecodingmachine/php:7.x-v4-cli) expect a command to be passed in parameter.
462+
The CLI images (thecodingmachine/php:{{ $image.php_version }}-v4-cli) expect a command to be passed in parameter.
460463
You should override the Docker "command".
461464

462465
Important! You should not override the Docker "entrypoint".

0 commit comments

Comments
 (0)