通过Docker部署失败

时间:2019-02-08 09:06:02

标签: docker jenkins

在通过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

预先感谢

1 个答案:

答案 0 :(得分:1)

好,所以我不知道您的构建阶段,因此我将基本映像视为centos。看来您缺少启用的remi repo。也许您可以尝试启用remi repo并安装最新的remi版本,因此,您可能需要在以下两个命令中添加Dockerfile:RUN yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpmRUN 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