Step 2/9 : RUN pecl install grpc
---> Running in 0b61c6790db4
No releases available for package "pecl.php.net/grpc"
install failed
The command '/bin/sh -c pecl install grpc' returned a non-zero code: 1
time="2020-11-28T01:29:26Z" level=fatal msg="exit status 1"
But I tried docker build . directly on my server, pecl can install grpc.
The docker plugin uses docker-in-docker. In order for the docker-in-docker daemon to inherit dns settings you may need to set the plugins mtu value (see the plugin documentation for a list of available settings). From this relevant thread Issue - Kubernetes Runner - Cert validation issues with Plugin/Docker
Thank you very much for @bradrydzewski 's answer!
MTU is the key to solving the problem. Happily, this problem can be solved easily. For those who are still troubled by this question, the answer to the question is: