2. When building based on Jenkins, the details of the error are as follows, as shown in Figure 1
Figure 1
Step 4 : COPY code/build/c_files/ /
---> f287879fb9ba
Removing intermediate container 8e0f70e90e2b
Step 5 : RUN chown -R nginx:nginx /sobey/www/ && rm -rf /etc/nginx/conf.d/status.conf && chmod +x /usr/local/bin/composer && cd /sobey/www/pcs-api && composer install --no-dev
---> Running in 0c4904881ff7
The command '/bin/sh -c chown -R nginx:nginx /sobey/www/ && rm -rf /etc/nginx/conf.d/status.conf && chmod +x /usr/local/bin/composer && cd /sobey/www/pcs-api && composer install --no-dev' returned a non-zero code: 255
Build step 'Docker Build and Publish' marked build as failure
Finished: FAILURE
3. Edit the dockerfile, temporarily cancel the composer related, after the build is successful, run composer -v in the docker container, no response, as shown in Figure 2
Figure 2
FROM registry-vpc.cn-beijing.aliyuncs.com/cmc/centos-nginx112-php71:0.2.4
MAINTAINER wjtester@sobey.com
COPY code /sobey/www/pcs-api
COPY code/build/c_files/ /
RUN chown -R nginx:nginx /sobey/www/ && \
rm -rf /etc/nginx/conf.d/status.conf
4. Edit the Dockerfile, edit the configuration in php.ini: open_basedir (add a directory tree of files that php can open /usr/local/php/), allow_url_fopen, as shown in Figure 3
Figure 3
FROM registry-vpc.cn-beijing.aliyuncs.com/cmc/centos-nginx112-php71:0.2.4
MAINTAINER wjtester@sobey.com
RUN sed -i 's/open_basedir = .\/:\/sobey:\/tmp:\/data:\/webtv/;open_basedir = .\/:\/sobey:\/tmp:\/data:\/webtv:\/usr\/local\/php/g' /usr/local/php/etc/php.ini && \
sed -i 's/allow_url_fopen = Off/allow_url_fopen = On/g' /usr/local/php/etc/php.ini
COPY code /sobey/www/pcs-api
COPY code/build/c_files/ /
RUN chown -R nginx:nginx /sobey/www/ && \
rm -rf /etc/nginx/conf.d/status.conf && \
chmod +x /usr/local/bin/composer && \
cd /sobey/www/pcs-api && \
composer install
5. When it is built based on Jenkins, it is in line with expectations, as shown in Figure 4
Figure 4
Leave a Reply