RobLoach / docker-composer

:ok_woman: Docker container to install and run Composer.
https://hub.docker.com/r/library/composer/
Other
105 stars 50 forks source link

the requested PHP extension intl is missing #104

Open fe3dback opened 8 years ago

fe3dback commented 8 years ago

My dockerfile:

FROM php:7.1-apache

RUN apt-get update && apt-get install -y \
        libicu-dev \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libmcrypt-dev \
        libpng12-dev \
    &&docker-php-ext-install -j$(nproc) mcrypt \
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install -j$(nproc) gd \
    && docker-php-ext-install -j$(nproc) intl

my compose config:

app:
  build: .
  container_name: au-app
  dockerfile: Dockerfile.app
  ports:
    - 8000:80
  volumes: 
    - ./:/var/www/html/

composer:
  image: composer/composer:latest
  volumes:
    - ./:/app
  command: install

first build app:

docker-compose build its ok.

then start:

docker-compose up

I get this errors:

composer_1  | Loading composer repositories with package information
composer_1  | Installing dependencies (including require-dev) from lock file
composer_1  | Your requirements could not be resolved to an installable set of packages.
composer_1  | 
au-app      | [Sat Sep 10 23:38:35.599648 2016] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) PHP/7.1.0RC1 configured -- resuming normal operations
composer_1  |   Problem 1
composer_1  |     - Installation request for cakephp/cakephp 3.2.5 -> satisfiable by cakephp/cakephp[3.2.5].
composer_1  |     - cakephp/cakephp 3.2.5 requires ext-intl * -> the requested PHP extension intl is missing from your system.

but intl is exist in system, and accessible from cli/apache both. for example:

run bash from last builded image

$ docker run -it aus_app bash
$ php -m

this give:

[PHP Modules]
Core
ctype
curl
date
dom
fileinfo
filter
ftp
gd
hash
iconv
**intl**
... and so on

in phpinfo:

intl
Internationalization support    enabled
version 1.1.0
ICU version 52.1
ICU Data version    52.1

I want build my project by docker, then install vendor requirements by composer.

fe3dback commented 8 years ago

solved by adding arg --ignore-platform-reqs to install command:

command: install --ignore-platform-reqs

but why normaly it isnt work?

alcohol commented 7 years ago

The composer image does not contain the extension. Your application image does. Composer is not running inside your application image though, it is running inside its own image. You can create a custom image that extends the composer image and adds the necessary extension(s) for your application. But if you do not need these extensions for the install step, then it is best to just rely on --ignore-platform-reqs.

MichaelBrauner commented 5 years ago

How do I build custom images with extensions like gd ?