How to build Docker container with Swoole and Postgresql enabled

I tried a lot to build Swoole with Postgresql enabled, but to no avail. This was my last attempt:

FROM php:7.2-fpm

ENV SWOOLE_VERSION=4.2.9

RUN     apt-get update && apt-get install -y libpq-dev 
    && cd /tmp && curl -sSL "https://github.com/swoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz" | tar xzf - 
    && cd swoole-src-${SWOOLE_VERSION} 
    && phpize && ./configure --enable-coroutine --enable-coroutine-postgresql > /dev/null && make > /dev/null && make install > /dev/null 
    && docker-php-ext-enable swoole

RUN touch /usr/local/etc/php/conf.d/swoole.ini && 
echo 'extension=swoole.so' > /usr/local/etc/php/conf.d/swoole.ini

But it does not work. I get an error message:

configure: WARNING: unrecognized options: –enable-coroutine

How can I fix it and build Swoole from scratch with Postgresql enabled?

Source: StackOverflow