krakjoe / parallel

A succinct parallel concurrency API for PHP8
Other
1.48k stars 96 forks source link

How to build Docker image with parallel using pecl #122

Closed Mariyo closed 4 years ago

Mariyo commented 4 years ago

Hello,

I am facing problem, that I am not able to build Docker image due to ZTS not enabled.

Dockerfile:

FROM php:zts
RUN pecl install parallel-beta
CMD tail -f /dev/stdout

Error:

checking for ZTS... configure: error: parallel requires ZTS, please use PHP with ZTS enabled
ERROR: `/tmp/pear/temp/parallel/configure --with-php-config=/usr/local/bin/php-config' failed

Thank you for any advice

rybakit commented 4 years ago

Here is how I do it without pecl: https://github.com/tarantool-php/benchmarks/blob/master/Dockerfile#L35-L37

fredericdepuydt commented 4 years ago

If you're OK with an alpine container, try this:

FROM php:7.3-zts-alpine

RUN apk update
RUN apk add --no-cache \
        $PHPIZE_DEPS
RUN pecl install parallel \
    && docker-php-ext-enable parallel
Mariyo commented 4 years ago

Hi,

for sure I am OK with alpine :)

It works now, I can give a try,

Thank you