ext-async icon indicating copy to clipboard operation
ext-async copied to clipboard

docker install error

Open dongasai opened this issue 4 years ago • 1 comments

Dockerfile

#
# php-phalcon 7.2 Dockerfile
#

FROM php:7.2-cli

MAINTAINER Dongasai [email protected]

#更新apt-get源 使用163的源 buster/updates
RUN echo "deb http://mirrors.163.com/debian/ buster main non-free contrib" > /etc/apt/sources.list && \
    echo "deb http://mirrors.163.com/debian/ buster-updates main non-free contrib " >> /etc/apt/sources.list  && \
    echo "deb http://mirrors.163.com/debian/ buster-backports main non-free contrib " >> /etc/apt/sources.list && \
    echo "deb-src http://mirrors.163.com/debian/ buster main non-free contrib " >> /etc/apt/sources.list && \
    echo "deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib " >> /etc/apt/sources.list && \
    echo "deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib " >> /etc/apt/sources.list  && \
    echo "deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib  " >> /etc/apt/sources.list  && \
    echo "deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib " >> /etc/apt/sources.list


RUN apt-get update;
RUN apt-get install -y git vim wget zip zlib1g-dev;
# 安装常用扩展
RUN docker-php-ext-install pdo pdo_mysql;docker-php-ext-enable pdo pdo_mysql;
RUN docker-php-ext-install bcmath zip mbstring;
RUN apt-get install -y \
		libfreetype6-dev \
		libjpeg62-turbo-dev \
		libpng-dev \
	&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
	&& docker-php-ext-install gd
	
RUN pecl install redis && docker-php-ext-enable redis 
RUN apt-get install -y libmemcached-dev zlib1g-dev 
RUN pecl install memcached && docker-php-ext-enable memcached
# pecl install inotify
RUN pecl install inotify && docker-php-ext-enable inotify

# 安装 composer
RUN wget https://mirrors.aliyun.com/composer/composer.phar;chmod +x composer.phar; mv composer.phar /usr/local/bin/composer;
RUN composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/


# 安装phalcon
ENV PHALCON_VERSION=3.4.5
RUN curl -sSL "https://codeload.github.com/phalcon/cphalcon/tar.gz/v${PHALCON_VERSION}" | tar -xz \
    && cd cphalcon-${PHALCON_VERSION}/build \
    && ./install \
    && cp ../tests/_ci/phalcon.ini $(php-config --configure-options | grep -o "with-config-file-scan-dir=\([^ ]*\)" | awk -F'=' '{print $2}') \
    && cd ../../ \
    && rm -r cphalcon-${PHALCON_VERSION}
# 安装phalcon 的开发工具包
WORKDIR /home
ENV PHALCON_DEVTOOL_VERSION=3.4.7
RUN curl -sSL "https://github.com/phalcon/phalcon-devtools/archive/v${PHALCON_DEVTOOL_VERSION}.tar.gz" | tar -xz \
    && cd phalcon-devtools-${PHALCON_DEVTOOL_VERSION} \
    && ./phalcon.sh \
    && ln -s /home/phalcon-devtools-${PHALCON_DEVTOOL_VERSION}0/phalcon.php /usr/bin/phalcon
# 安装swoole 版本 
RUN pecl install swoole;docker-php-ext-enable swoole;
RUN php -m
# 安装swoole 异步扩展
ENV SWOOLE_ASYNC_VERSION 4.4.9
RUN curl -sSL "https://github.com/swoole/ext-async/archive/v${SWOOLE_ASYNC_VERSION}.tar.gz"  | tar -xz \
    && cd ext-async-${SWOOLE_ASYNC_VERSION} \ 
    && phpize && ./configure \
    && make \ 
    && make install
RUN php -m
#     
#     && ./phalcon.sh \
#     && ln -s /home/phalcon-devtools-${SWOOLE_ASYNC_VERSION}0/phalcon.php /usr/bin/phalcon
# 4.4.10
# git clone https://github.com/swoole/ext-async.git
# cd ext-async
# phpize
# 
# 
# sudo make install



#重置工作目录
WORKDIR /var/www/html

out

Step 21/25 : RUN php -m
 ---> Running in ec96a154a3f1
[PHP Modules]
bcmath
Core
ctype
curl
date
dom
fileinfo
filter
ftp
gd
hash
iconv
inotify
json
libxml
mbstring
memcached
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
phalcon
Phar
posix
readline
redis
Reflection
session
SimpleXML
sodium
SPL
sqlite3
standard
swoole
tokenizer
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]

Removing intermediate container ec96a154a3f1
 ---> 490d1d9bca2c
Step 22/25 : ENV SWOOLE_ASYNC_VERSION 4.4.9
 ---> Running in 933ade116256
Removing intermediate container 933ade116256
 ---> d075d989fcee
Step 23/25 : RUN curl -sSL "https://github.com/swoole/ext-async/archive/v${SWOOLE_ASYNC_VERSION}.tar.gz"  | tar -xz     && cd ext-async-${SWOOLE_ASYNC_VERSION}     && phpize && ./configure     && make     && make install
 ---> Running in 1d6be603016c
Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
Zend Extension Api No:   320170718
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20170718
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 1.1.1 (ok)
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking swoole_async support... yes, shared
checking whether to enable asan... no
checking if compiling with clang... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
(cached) (cached) checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
/bin/bash /home/ext-async-4.4.9/libtool --mode=compile g++  -I. -I/home/ext-async-4.4.9 -DPHP_ATOM_INC -I/home/ext-async-4.4.9/include -I/home/ext-async-4.4.9/main -I/home/ext-async-4.4.9 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/home/ext-async-4.4.9 -I/home/ext-async-4.4.9/include -I/usr/local/include/php/ext/swoole -I/usr/local/include/php/ext/swoole/include  -DHAVE_CONFIG_H  -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11   -c /home/ext-async-4.4.9/swoole_async.cc -o swoole_async.lo 
mkdir .libs
 g++ -I. -I/home/ext-async-4.4.9 -DPHP_ATOM_INC -I/home/ext-async-4.4.9/include -I/home/ext-async-4.4.9/main -I/home/ext-async-4.4.9 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/home/ext-async-4.4.9 -I/home/ext-async-4.4.9/include -I/usr/local/include/php/ext/swoole -I/usr/local/include/php/ext/swoole/include -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /home/ext-async-4.4.9/swoole_async.cc  -fPIC -DPIC -o .libs/swoole_async.o
In file included from /home/ext-async-4.4.9/swoole_async.cc:17:
/home/ext-async-4.4.9/php_swoole_async.h:26:10: fatal error: ext/swoole/php_swoole.h: No such file or directory
 #include "ext/swoole/php_swoole.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:194: swoole_async.lo] Error 1
ERROR: Service 'cli' failed to build: The command '/bin/sh -c curl -sSL "https://github.com/swoole/ext-async/archive/v${SWOOLE_ASYNC_VERSION}.tar.gz"  | tar -xz     && cd ext-async-${SWOOLE_ASYNC_VERSION}     && phpize && ./configure     && make     && make install' returned a non-zero code: 2

dongasai avatar Nov 05 '19 16:11 dongasai

Ubuntu 18.04.3 LTS

Linux version 5.0.0-32-generic (buildd@lgw01-amd64-015) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #34~18.04.2-Ubuntu SMP Thu Oct 10 10:36:02 UTC 2019

Docker version 18.09.7, build 2d0083d

dongasai avatar Nov 05 '19 16:11 dongasai