Il 02/08/20 11:49, Arno Welzel ha scritto:
> No, you just did not do what they said:
>
> #remove this
> #dockerfile: extensions
> #image: php:7-fpm
> #change with build ...
>
> Then, add Dockerfile file to the docker/php folder:
>
> FROM php:7-fpm
>
> RUN apt-get update && apt-get install -y \
> libicu-dev \
> && docker-php-ext-install \
> intl \
> && docker-php-ext-enable \
> intl
>
> Of course you have to adapt this to your needs (yaml instead of intl and
> you don't need libicu-dev).
--- docker-compose.yml (snippet) ---
wordpress:
#image: wordpress:latest
build: 'docker/php'
--- EOF ---
$ cat docker/php/Dockerfile
FROM php:7-fpm
RUN apt-get update && apt-get install -y \
&& docker-php-ext-install \
yaml \
&& docker-php-ext-enable \
yaml
$ docker-compose build
db uses an image, skipping
Building wordpress
Step 1/2 : FROM php:7-fpm
---> d7f856a7dcc7
Step 2/2 : RUN apt-get update && apt-get install -y &&
docker-php-ext-install yaml && docker-php-ext-enable
yaml
---> Running in e43351dcd302
Get:1
http://deb.debian.org/debian buster InRelease [122 kB]
Get:2
http://security.debian.org/debian-security buster/updates
InRelease [65.4 kB]
Get:3
http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Get:4
http://deb.debian.org/debian buster/main amd64 Packages [7906 kB]
Get:5
http://security.debian.org/debian-security buster/updates/main
amd64 Packages [217 kB]
Get:6
http://deb.debian.org/debian buster-updates/main amd64 Packages
[7868 B]
Fetched 8370 kB in 7s (1150 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following package was automatically installed and is no longer required:
lsb-base
Use 'apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
error: /usr/src/php/ext/yaml does not exist
usage: /usr/local/bin/docker-php-ext-install [-jN] [--ini-name file.ini]
ext-name [ext-name ...]
ie: /usr/local/bin/docker-php-ext-install gd mysqli
/usr/local/bin/docker-php-ext-install pdo pdo_mysql
/usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo
pdo_mysql shmop
if custom ./configure arguments are necessary, see docker-php-ext-configure
Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif ffi fileinfo filter
ftp gd gettext gmp hash iconv imap intl json ldap mbstring mysqli oci8
odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc
pdo_pgsql pdo_sqlite pgsql phar posix pspell readline reflection session
shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem
sysvshm tidy tokenizer xml xmlreader xmlrpc xmlwriter xsl zend_test zip
Some of the above modules are already compiled into PHP; please check
the output of "php -i" to see which modules are already loaded.
ERROR: Service 'wordpress' failed to build: The command '/bin/sh -c
apt-get update && apt-get install -y && docker-php-ext-install
yaml && docker-php-ext-enable yaml' returned a non-zero
code: 1