在容器内安装扩展

I have to install it manually.
First: Login into your php container as root, then install via pecl.

docker exec -it -u 0 php /bin/sh
pecl install ast-1.0.1

After that, you need to enable it in php.ini like:

extension=ast.so

restart php-fpm  in docker with

kill -USR2 1

This solves my problem and may help. (edited)