反馈:Docker部署PHP教程中,构建时 `docker build -t my-php:7.2.6-fpm .` 出现错误。

fangnan       1 月 前       77

教程地址: https://www.twle.cn/l/yufei/docker/docker-basic-install-php.html

错误如下:

/bin/bash /usr/src/php/libtool --silent --preserve-dup-deps --mode=compile cc -I/usr/src/php/ext/fileinfo/libmagic -Iext/fileinfo/ -I/usr/src/php/ext/fileinfo/ -DPHP_ATOM_INC -I/usr/src/php/include -I/usr/src/php/main -I/usr/src/php -I/usr/src/php/ext/date/lib -I/usr/include/libxml2 -I/usr/src/php/ext/mbstring/oniguruma -I/usr/src/php/ext/mbstring/libmbfl -I/usr/src/php/ext/mbstring/libmbfl/mbfl -I/usr/src/php/ext/sqlite3/libsqlite -I/usr/src/php/TSRM -I/usr/src/php/Zend    -I/usr/include -g -O2 -fvisibility=hidden -DZEND_SIGNALS   -c /usr/src/php/ext/fileinfo/libmagic/apprentice.c -o ext/fileinfo/libmagic/apprentice.lo 
cc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.
make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1
Makefile:841: recipe for target 'ext/fileinfo/libmagic/apprentice.lo' failed
make: *** Waiting for unfinished jobs....
The command '/bin/sh -c set -xe && buildDeps=" $PHP_EXTRA_BUILD_DEPS libcurl4-openssl-dev libedit-dev libsqlite3-dev libssl-dev libxml2-dev xz-utils "     && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/*     && curl -fSL "http://php.net/get/$PHP_FILENAME/from/this/mirror" -o "$PHP_FILENAME"     && mkdir -p /usr/src/php     && tar -xf "$PHP_FILENAME" -C /usr/src/php --strip-components=1     && rm "$PHP_FILENAME"     && cd /usr/src/php     && ./configure --with-config-file-path="$PHP_INI_DIR"         --with-config-file-scan-dir="$PHP_INI_DIR/conf.d"         $PHP_EXTRA_CONFIGURE_ARGS         --disable-cgi --enable-mysqlnd --enable-mbstring         --with-curl --with-libedit --with-openssl --with-zlib     && make -j"$(nproc)"     && make install     && { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; }     && make clean     && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $buildDeps' returned a non-zero code: 2

好像是编译错误,怎么解决,新手懵逼了。

[root@active-cube-4 php]# docker images
REPOSITORY           TAG                 IMAGE ID       CREATED             SIZE
<none>               <none>              e20a0c82f1a4   6 minutes ago       316MB
twle/nginx           1.13.12-l-stretch   aaebdd429438   48 minutes ago      109MB
twle/flash_365_102   latest              e5b502407fa5   56 minutes ago      922MB
twle/my-flask        365-102             e5b502407fa5   56 minutes ago      922MB
twle/py365flask102   latest              aba8ae7c8124   About an hour ago   922MB
php                  latest              7a9e4bdd6171   2 weeks ago         423MB
nginx                latest              d1a364dc548d   3 weeks ago         133MB
debian               stretch-slim        e59fcdf363c2   5 weeks ago         55.3MB
debian               jessie              3aaeab7a4777   2 months ago        129MB
hello-world          latest              d1165f221234   3 months ago        13.3kB
jcdemo/flaskapp      latest              4f7a2cc79052   2 years ago         88.7MB
ubuntu               17.10               e211a66937c6   2 years ago         100MB
python               3.6.5               9a58cce9b09f   2 years ago         912MB
php                  7.2.6-fpm-stretch   ec2b78198184   2 years ago         367MB

无论我从github还是 手动复制php目录下那些文件都是这样。 非常感谢,我学会Docker了。

1 回复  |  直到 Jun 21, 2021

yufei

#1   •   1 月 前   •  

你暂时先用拉镜像的方式解决。Dockerfile 的方式我回到家之后看看

简单教程 = 简单教程,简单编程
简单教程 是一个关于技术和学习的地方
现在注册
已注册用户请 登入
什么意思
什么意思
关于   |   FAQ   |   我们的愿景   |   广告投放   |  博客

  简单教程,简单编程 - IT 入门首选站

Copyright © 2013-2018 简单教程 twle.cn All Rights Reserved.