通过Jenkins在我们的应用程序中部署docker镜像时,我们面临问题。请任何人在这里帮助我。
Step 12/20 : RUN php installer
---> Running in 253d14820221
[91m/bin/sh: php: command not found
[0mThe command '/bin/sh -c php installer' returned a non-zero code: 127
[Pipeline] }
[Pipeline] // dir
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 127
Finished: FAILURE
附加的docker文件-
ENV BUILD_ARGS=""
RUN yum -y update
RUN yum -y install epel-release wget
RUN wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN wget https://centos7.iuscommunity.org/ius-release.rpm
RUN rpm -Uvh ius-release*.rpm
RUN yum -y update
RUN yum -y install php56u php56u-opcache php56u-xml php56u-mcrypt php56u-gd php56u-devel php56u-mysql php56u-intl php56u-mbstring php56u-bcmath nodejs git make gcc*
RUN npm install -g gulp bower
RUN wget https://getcomposer.org/installer
RUN php installer
RUN php -r "unlink('composer-setup.php');"
RUN ["mv", "/composer.phar", "/usr/local/bin/composer"]
COPY build.sh build
RUN chmod +x build
COPY cleanup.sh cleanup
RUN chmod +x cleanup
VOLUME "/wordpress"
CMD /build
提前致谢
最佳答案
好的,所以我不知道您的构建阶段,因此我将基本镜像视为centos。好像您缺少启用的remi repo。也许您可以尝试启用remi repo并安装最新的remi版本,因此,您可能需要在以下两个命令中添加Dockerfile:RUN yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
和RUN yum-config-manager --enable remi-php56
,然后查看是否适合您。另外,您会注意到php56u更改为php。
FROM centos
ENV BUILD_ARGS=""
RUN yum -y update
RUN yum -y install epel-release wget
RUN wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN wget https://centos7.iuscommunity.org/ius-release.rpm
RUN yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
RUN rpm -Uvh ius-release*.rpm
RUN yum -y update
RUN yum-config-manager --enable remi-php56
RUN yum -y install php php-opcache php-xml php-mcrypt php-gd php-devel php-mysql php-intl php-mbstring php-bcmath nodejs git make gcc*
RUN npm install -g gulp bower
RUN wget https://getcomposer.org/installer
RUN php installer