简体   繁体   中英

Docker container fails to build when installing GRPC

I have a Dockerfile that when used with my docker-compose commands works fine, I'd like to have this docker container built however as GRPC takes 15 mins to install every time I want to run tests in GitHub Actions

This is what my Dockerfile currently looks like:

FROM xxx-base:6

RUN pecl install grpc \
    && docker-php-ext-enable grpc \

WORKDIR /application

And I get the following error output:

#5 580.4 g++: fatal error: Killed signal terminated program cc1plus
#5 580.4 compilation terminated.
#5 580.4 make: *** [Makefile:248: src/core/ext/filters/client_channel/lb_policy/xds/cds.lo] Error 1
#5 580.5 ERROR: `make' failed
------
executor failed running [/bin/sh -c sudo pecl install grpc     && docker-php-ext-enable grpc WORKDIR /application]: exit code: 1

It's worth mentioning in the base container used here I used pecl to install imagik so I know that command at least partially works. This is a base PHP 7.4 container.

Any suggestions, I've seen some other posts referring to the memory limit on the docker build, but I'm not sure what to change

Pastebin full stacktrace: pastebin.com/g7iZ2uRn

Installing GRPC in a pipeline takes a long time. I recommend using the cache of the provider used (bitbucket, github etc ..) or using a base image which is used as the starting point of the Dockerfile

FROM baseimage:latest

I have implemented an image based on alpine and php 7.4 with extension grpc installed, check it on github gits click here

In case gcc –version says anything less than 4.9 ...this might be the cause.

This answer also seems to be related to your scenario... in case PECL fails.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM